'use client';

import type { ReactNode } from 'react';
import { usePathname } from 'next/navigation';

export const AppShell = ({ children }: { children: ReactNode }) => {
  const pathname = usePathname();
  const isWorkspace =
    /\/spoons\/[^/]+\/agent\/[^/]+/.test(pathname) ||
    /^\/threads\/[^/]+/.test(pathname);

  return (
    <div className='bg-muted/20 flex-1 border-t'>
      <div
        className={
          isWorkspace
            ? 'min-w-0 px-3 py-3 md:px-4'
            : 'container mx-auto min-w-0 px-4 py-6 md:px-6'
        }
      >
        {children}
      </div>
    </div>
  );
};
