import { Worker, WorkerKind } from '@/lib/gql/generates/graphql' import { cn } from '@/lib/utils' import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card' type RunnerType = WorkerKind | 'INDEX' interface RunnerCardProps extends Partial> { kind: RunnerType } export default function RunnerCard({ addr, name, kind, device, cudaDevices, cpuCount, cpuInfo }: RunnerCardProps) { const textClass = cn( 'ml-2', 'whitespace-nowrap', 'overflow-hidden', 'text-ellipsis' ) const cpuMessage = `${cpuInfo} (${cpuCount} cores)` return (

{name}

{addr}

{cpuMessage}

{device == 'cuda' && cudaDevices?.length && cudaDevices.map((x, i) => (

{x}

))}
) } interface InfoProps { children: React.ReactNode } function Info({ children }: InfoProps) { return (
{children}
) } function ModelIcon({ type }: { type: RunnerType }) { const className = 'h-5 w-5' if (type == WorkerKind.Completion) { return ( ) } else if (type == WorkerKind.Chat) { return ( ) } else if (type == 'INDEX') { return ( ) } }