import { useState, useEffect } from 'react'; import type { ReactNode } from 'react'; import Sidebar from './Sidebar'; import MobileNav from './MobileNav'; interface Props { children: ReactNode; userName?: string; botName?: string; } export default function DashboardLayout({ children, userName, botName = 'Bloby' }: Props) { const [status, setStatus] = useState<'healthy' | 'restarting'>('healthy'); useEffect(() => { const check = () => { fetch('/app/api/health', { signal: AbortSignal.timeout(3000) }) .then((r) => { setStatus(r.ok ? 'healthy' : 'restarting'); }) .catch((err) => { setStatus('restarting'); }); }; check(); const id = setInterval(check, 10_000); return () => clearInterval(id); }, []); return (
{botName}