Skip to content

🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

939 B
Raw Blame
'use client';

import * as stylex from '@stylexjs/stylex';
import { type FC } from 'react';
import { Outlet } from 'react-router';

import MobileContentLayout from '@/components/server/MobileNavLayout';
import { AgentNotFoundGuard } from '@/features/AgentNotFound';
import ChatHeader from '@/routes/(mobile)/chat/features/ChatHeader';

import { styles } from './style';

// Agent init and id sync live one level up in the agent scope layout
// (`(mobile)/agent/_layout`), which the chat shares with the sub-pages.
const Layout: FC = () => (
  <MobileContentLayout
    className={stylex.props(styles.mainContainer).className}
    header={<ChatHeader />}
  >
    {/* Same 404 fallback as the desktop agent layout: only the content area
        collapses when the routed agent is gone or turned private. */}
    <AgentNotFoundGuard showAgentList>
      <Outlet />
    </AgentNotFoundGuard>
  </MobileContentLayout>
);

export default Layout;