import { ChevronDownIcon, CopyIcon } from '@primer/octicons-react' import { Link } from '@remix-run/react' import Menu from '~/components/Menu' import StatusCircle from '~/components/StatusCircle' import { toast } from '~/components/Toaster' import { type Machine, type Route, User } from '~/types' import { cn } from '~/utils/cn' import MenuOptions from './menu' interface Props { readonly machine: Machine readonly routes: Route[] readonly users: User[] readonly magic?: string } export default function MachineRow({ machine, routes, magic, users }: Props) { const expired = machine.expiry === '0001-01-01 00:00:00' || machine.expiry === '0001-01-01T00:00:00Z' ? false : new Date(machine.expiry).getTime() < Date.now() const tags = [ ...machine.forcedTags, ...machine.validTags, ] if (expired) { tags.unshift('Expired') } return (
{machine.givenName}
{machine.name}
{machine.online && !expired ? 'Connected' : new Date( machine.lastSeen, ).toLocaleString()}