AppContent.tsx 553 B

12345678910111213141516171819
  1. import * as React from 'react';
  2. import { SidebarInset } from '@/shadcn/sidebar';
  3. interface AppContentProps extends React.ComponentProps<'main'> {
  4. variant?: 'header' | 'sidebar';
  5. }
  6. export function AppContent({ variant = 'header', children, ...props }: AppContentProps) {
  7. if (variant === 'sidebar') {
  8. return <SidebarInset {...props}>{children}</SidebarInset>;
  9. }
  10. return (
  11. <main className="mx-auto flex h-full w-full max-w-7xl flex-1 flex-col gap-4 rounded-xl" {...props}>
  12. {children}
  13. </main>
  14. );
  15. }