ExplorerPageShell.jsx 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. import React from "react";
  2. /**
  3. * ExplorerPageShell
  4. *
  5. * Consistent framing for all Explorer pages:
  6. * - Title + optional description
  7. * - Breadcrumbs as ReactNode (supports dropdown composition)
  8. * - Optional actions (refresh, etc.)
  9. *
  10. * The shell intentionally does not "build" breadcrumbs to avoid tight coupling
  11. * and to keep dropdown variants easy and clean.
  12. *
  13. * @param {{
  14. * title: string,
  15. * description?: string|null,
  16. * breadcrumbs?: React.ReactNode,
  17. * actions?: React.ReactNode,
  18. * children: React.ReactNode
  19. * }} props
  20. */
  21. export default function ExplorerPageShell({
  22. title,
  23. description = null,
  24. breadcrumbs = null,
  25. actions = null,
  26. children,
  27. }) {
  28. return (
  29. <div className="space-y-4">
  30. <div className="flex items-start justify-between gap-4">
  31. <div className="space-y-1">
  32. <h1 className="text-2xl font-semibold tracking-tight">{title}</h1>
  33. {description ? (
  34. <p className="text-sm text-muted-foreground">{description}</p>
  35. ) : null}
  36. </div>
  37. {actions ? <div className="shrink-0">{actions}</div> : null}
  38. </div>
  39. {breadcrumbs ? <div>{breadcrumbs}</div> : null}
  40. {children}
  41. </div>
  42. );
  43. }