import { Form, useSubmit } from 'react-router'; import { type Dispatch, type SetStateAction, useState } from 'react'; import Code from '~/components/Code'; import Dialog from '~/components/Dialog'; import Select from '~/components/Select'; import type { Machine, User } from '~/types'; interface MoveProps { readonly machine: Machine; readonly users: User[]; readonly state: [boolean, Dispatch>]; readonly magic?: string; } export default function Move({ machine, state, magic, users }: MoveProps) { const [owner, setOwner] = useState(machine.user.name); const submit = useSubmit(); return ( {(close) => ( <> Change the owner of {machine.givenName} The owner of the machine is the user associated with it.
{ submit(e.currentTarget); }} > {magic ? (

This machine is accessible by the hostname{' '} {machine.givenName}.{magic} .

) : undefined}
Cancel Change owner
)}
); }