/* eslint-disable react/hook-use-state */ import { ChevronDownIcon, ClipboardIcon, EllipsisHorizontalIcon } from '@heroicons/react/24/outline' import { type FetcherWithComponents, Link } from '@remix-run/react' import { useState } from 'react' import toast from 'react-hot-toast/headless' import Dialog from '~/components/Dialog' import Menu from '~/components/Menu' import StatusCircle from '~/components/StatusCircle' import { type Machine } from '~/types' import { cn } from '~/utils/cn' import Delete from './dialogs/delete' import Rename from './dialogs/rename' type MachineProperties = { readonly machine: Machine; readonly fetcher: FetcherWithComponents; readonly magic?: string; } export default function MachineRow({ machine, fetcher, magic }: MachineProperties) { const tags = [...machine.forcedTags, ...machine.validTags] const renameState = useState(false) const removeState = useState(false) return (

{machine.givenName}

{machine.name}

{tags.map(tag => ( {tag} ))}
{machine.ipAddresses[0]} {machine.ipAddresses.map(ip => ( ))} {magic ? ( ) : undefined}

{machine.online ? 'Connected' : new Date( machine.lastSeen ).toLocaleString()}

Edit machine name Edit route settings Edit ACL tags Remove ) }