import { ChevronDownIcon, ClipboardIcon, EllipsisHorizontalIcon } from '@heroicons/react/24/outline' import { type FetcherWithComponents, Link } from '@remix-run/react' import clsx from 'clsx' import toast from 'react-hot-toast/headless' import Dropdown from '~/components/Dropdown' import type { OpenFunction } from '~/components/Modal' import StatusCircle from '~/components/StatusCircle' import { type Machine } from '~/types' type MachineProperties = { readonly machine: Machine; readonly open: OpenFunction; readonly fetcher: FetcherWithComponents; readonly magic?: string; } export default function MachineRow({ machine, open, fetcher, magic }: MachineProperties) { const tags = [...machine.forcedTags, ...machine.validTags] 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()}

)} >
) }