doc-article.tsx 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. import Link from "next/link";
  2. import type { ReactNode } from "react";
  3. import { PageShell } from "@/components/layout/page-shell";
  4. export function DocArticle({
  5. title,
  6. description,
  7. children,
  8. }: {
  9. title: string;
  10. description: string;
  11. children: ReactNode;
  12. }) {
  13. return (
  14. <PageShell
  15. title={title}
  16. description={description}
  17. backHref="/portal/docs"
  18. backLabel="Back to docs"
  19. >
  20. <article className="prose-measure max-w-2xl space-y-6 text-sm leading-relaxed text-muted-foreground">
  21. {children}
  22. </article>
  23. <p className="mt-10 text-sm">
  24. <Link
  25. href="/portal/docs"
  26. className="text-accent-hover hover:underline"
  27. >
  28. ← All docs
  29. </Link>
  30. </p>
  31. </PageShell>
  32. );
  33. }
  34. export function DocH2({ children }: { children: ReactNode }) {
  35. return (
  36. <h2 className="font-display text-lg font-semibold tracking-tight text-foreground">
  37. {children}
  38. </h2>
  39. );
  40. }
  41. export function DocP({ children }: { children: ReactNode }) {
  42. return <p className="text-muted-foreground">{children}</p>;
  43. }
  44. export function DocUl({ items }: { items: string[] }) {
  45. return (
  46. <ul className="list-disc space-y-2 pl-5 text-muted-foreground">
  47. {items.map((item) => (
  48. <li key={item}>{item}</li>
  49. ))}
  50. </ul>
  51. );
  52. }