'use client' import { buttonVariants } from '@/components/ui/button' import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle } from '@/components/ui/dialog' import { IconSlack } from '@/components/ui/icons' import { Separator } from '@/components/ui/separator' import { useHealth } from '@/lib/hooks/use-health' import { PropsWithChildren, useEffect, useState } from 'react' import WorkerCard from './components/worker-card' import { useWorkers } from '@/lib/hooks/use-workers' import { WorkerKind } from '@/lib/gql/generates/graphql' import { useGraphQL } from '@/lib/hooks/use-graphql' import { getRegistrationTokenDocument } from '@/lib/gql/request-documents' import { CopyButton } from '@/components/copy-button' const COMMUNITY_DIALOG_SHOWN_KEY = 'community-dialog-shown' export default function Home() { const [open, setOpen] = useState(false) useEffect(() => { if (!localStorage.getItem(COMMUNITY_DIALOG_SHOWN_KEY)) { setOpen(true) localStorage.setItem(COMMUNITY_DIALOG_SHOWN_KEY, 'true') } }, []) return (
Join the Tabby community Connect with other contributors building Tabby. Share knowledge, get help, and contribute to the open-source project. Join us on Slack
) } interface LinkProps { href: string } function Link({ href, children }: PropsWithChildren) { return ( {children} ) } function toBadgeString(str: string) { return encodeURIComponent(str.replaceAll('-', '--')) } function MainPanel() { const { data: healthInfo } = useHealth() const workers = useWorkers(healthInfo) const { data: registrationTokenRes } = useGraphQL( getRegistrationTokenDocument ) if (!healthInfo) return return (

Congratulations, your tabby instance is up!

Workers {!!registrationTokenRes?.registrationToken && (
Registeration token:{' '} {registrationTokenRes.registrationToken}
)}
{!!workers?.[WorkerKind.Completion] && ( <> {workers[WorkerKind.Completion].map((worker, i) => { return })} )} {!!workers?.[WorkerKind.Chat] && ( <> {workers[WorkerKind.Chat].map((worker, i) => { return })} )}
) }