layout.tsx 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. import Link from "next/link";
  2. const navigation = [
  3. {
  4. title: "Getting Started",
  5. items: [
  6. { title: "Introduction", href: "/docs" },
  7. { title: "Installation", href: "/docs/installation" },
  8. { title: "Quick Start", href: "/docs/quick-start" },
  9. ],
  10. },
  11. {
  12. title: "Core Concepts",
  13. items: [
  14. { title: "Catalog", href: "/docs/catalog" },
  15. { title: "Components", href: "/docs/components" },
  16. { title: "Data Binding", href: "/docs/data-binding" },
  17. { title: "Actions", href: "/docs/actions" },
  18. { title: "Visibility", href: "/docs/visibility" },
  19. { title: "Validation", href: "/docs/validation" },
  20. ],
  21. },
  22. {
  23. title: "Guides",
  24. items: [
  25. { title: "AI SDK Integration", href: "/docs/ai-sdk" },
  26. { title: "Streaming", href: "/docs/streaming" },
  27. ],
  28. },
  29. {
  30. title: "API Reference",
  31. items: [
  32. { title: "@json-render/core", href: "/docs/api/core" },
  33. { title: "@json-render/react", href: "/docs/api/react" },
  34. ],
  35. },
  36. ];
  37. export default function DocsLayout({
  38. children,
  39. }: {
  40. children: React.ReactNode;
  41. }) {
  42. return (
  43. <div className="max-w-5xl mx-auto px-6 py-12 flex gap-16">
  44. {/* Sidebar */}
  45. <aside className="w-48 flex-shrink-0 hidden lg:block">
  46. <nav className="sticky top-20 space-y-6">
  47. {navigation.map((section) => (
  48. <div key={section.title}>
  49. <h4 className="text-xs font-medium text-muted-foreground uppercase tracking-wider mb-2">
  50. {section.title}
  51. </h4>
  52. <ul className="space-y-1">
  53. {section.items.map((item) => (
  54. <li key={item.href}>
  55. <Link
  56. href={item.href}
  57. className="text-sm text-muted-foreground hover:text-foreground transition-colors block py-1"
  58. >
  59. {item.title}
  60. </Link>
  61. </li>
  62. ))}
  63. </ul>
  64. </div>
  65. ))}
  66. </nav>
  67. </aside>
  68. {/* Content */}
  69. <div className="flex-1 min-w-0 max-w-2xl">
  70. {children}
  71. </div>
  72. </div>
  73. );
  74. }