import { type } from "arktype"; import { Computer, FileKey2 } from "lucide-react"; import { useState } from "react"; import { useNavigate } from "react-router"; import CodeBlock from "~/components/code-block"; import Dialog, { DialogPanel } from "~/components/dialog"; import Input from "~/components/input"; import { Menu, MenuContent, MenuItem, MenuTrigger } from "~/components/menu"; import Select from "~/components/select"; import Text from "~/components/text"; import Title from "~/components/title"; import { useForm } from "~/hooks/use-form"; import type { User } from "~/types"; import { getUserDisplayName } from "~/utils/user"; const registerSchema = type({ register_key: "string == 24", user: "string > 0", }); export interface NewMachineProps { server: string; users: User[]; isDisabled?: boolean; disabledKeys?: string[]; } export default function NewMachine(data: NewMachineProps) { const [pushDialog, setPushDialog] = useState(false); const form = useForm({ schema: registerSchema }); const navigate = useNavigate(); return ( <> Register Machine Key The machine key is given when you run the following command on your device: {`tailscale up --login-server=${data.server}`}