AuthCardLayout.tsx 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. import { Link } from '@inertiajs/react';
  2. import { type PropsWithChildren } from 'react';
  3. import { AppLogoIcon } from '@/common/AppLogoIcon';
  4. import { home } from '@/routes';
  5. import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/shadcn/card';
  6. export default function AuthCardLayout({
  7. children,
  8. title,
  9. description,
  10. }: PropsWithChildren<{
  11. name?: string;
  12. title?: string;
  13. description?: string;
  14. }>) {
  15. return (
  16. <div className="flex min-h-svh flex-col items-center justify-center gap-6 bg-muted p-6 md:p-10">
  17. <div className="flex w-full max-w-md flex-col gap-6">
  18. <Link href={home()} className="flex items-center gap-2 self-center font-medium">
  19. <div className="flex h-9 w-9 items-center justify-center">
  20. <AppLogoIcon className="size-9 fill-current text-black dark:text-white" />
  21. </div>
  22. </Link>
  23. <div className="flex flex-col gap-6">
  24. <Card className="rounded-xl">
  25. <CardHeader className="px-10 pt-8 pb-0 text-center">
  26. <CardTitle className="text-xl">{title}</CardTitle>
  27. <CardDescription>{description}</CardDescription>
  28. </CardHeader>
  29. <CardContent className="px-10 py-8">{children}</CardContent>
  30. </Card>
  31. </div>
  32. </div>
  33. </div>
  34. );
  35. }