AI store generator for ecommerce, Malaysia first. Laravel 13 + React + TypeScript.
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

app-shell.tsx 603B

123456789101112131415161718192021
  1. import { usePage } from '@inertiajs/react';
  2. import type { ReactNode } from 'react';
  3. import { SidebarProvider } from '@/components/ui/sidebar';
  4. import type { AppVariant } from '@/types';
  5. type Props = {
  6. children: ReactNode;
  7. variant?: AppVariant;
  8. };
  9. export function AppShell({ children, variant = 'sidebar' }: Props) {
  10. const isOpen = usePage().props.sidebarOpen;
  11. if (variant === 'header') {
  12. return (
  13. <div className="flex min-h-screen w-full flex-col">{children}</div>
  14. );
  15. }
  16. return <SidebarProvider defaultOpen={isOpen}>{children}</SidebarProvider>;
  17. }