import { useState } from "react"; import { Button, Card, Center, PasswordInput, Stack, Text, TextInput, ThemeIcon, Title, } from "@mantine/core"; import { IconShieldLock, IconKey } from "@tabler/icons-react"; import type { User } from "./types"; export function Login({ onLogin }: { onLogin: (u: User) => void }) { const [handle, setHandle] = useState(""); const [password, setPassword] = useState(""); const ready = handle.trim().length > 0 && password.length > 0; const connect = () => { const h = handle.trim(); if (ready) onLogin({ id: h, handle: h }); }; return (