import { PencilIcon } from '@primer/octicons-react' import { Form, useSubmit } from '@remix-run/react' import { useState } from 'react' import Button from '~/components/Button' import Code from '~/components/Code' import Dialog from '~/components/Dialog' import TextField from '~/components/TextField' interface Props { username: string magic?: string } export default function Rename({ username, magic }: Props) { const submit = useSubmit() const dialogState = useState(false) const [newName, setNewName] = useState(username) return ( <> {close => ( <> Rename {' '} {username} ? Enter a new username for {' '} {username} ? {magic ? (

{' '} Since Magic DNS is enabled, machines currently accessible via {' '} [machine]. {username} . {magic} {' '} will now become accessible via {' '} [machine]. {newName.length > 0 ? newName : '[new-username]'} . {magic} .

) : undefined}
{ submit(event.currentTarget) }} >
Cancel Rename
)}
) }