section.tsx 746 B

123456789101112131415161718192021222324252627
  1. import {Separator} from "@/components/ui/separator"
  2. export default function Section({
  3. title,
  4. description,
  5. action,
  6. children,
  7. }: {
  8. title: string
  9. description?: string
  10. action?: React.ReactNode
  11. children: React.ReactNode
  12. }) {
  13. return (
  14. <section className="w-full">
  15. <div className="flex flex-col md:flex-row md:items-end gap-2 md:gap-4">
  16. <div className="flex-1">
  17. <h2 className="text-lg md:text-xl font-semibold">{title}</h2>
  18. {description ? <p className="text-sm text-muted-foreground mt-1">{description}</p> : null}
  19. </div>
  20. {action ? <div className="shrink-0">{action}</div> : null}
  21. </div>
  22. <Separator className="my-4" />
  23. <div>{children}</div>
  24. </section>
  25. )
  26. }