import { Outlet } from 'react-router-dom';
import Sidebar from './Sidebar';
import TitleBar from './TitleBar';

export default function MainLayout() {
  const platform = (window as any).api?.platform ?? '';

  return (
    <div className="bg-white dark:!bg-[#0f0f10] h-screen flex flex-col">
      <TitleBar />

      <main
        className="box-border w-full flex pt-2 pb-2 pl-2"
        style={{ height: platform === 'linux' ? '100vh' : 'calc(100vh - 40px)' }}
      >
        <div className="flex-1 flex min-w-0 min-h-0">
          <Outlet />
        </div>
        <Sidebar />
      </main>
    </div>
  );
}
