page.tsx 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. import { Button } from "@/components/ui/button";
  2. export const metadata = {
  3. title: "Playground | json-render",
  4. };
  5. export default function PlaygroundPage() {
  6. return (
  7. <div className="max-w-4xl mx-auto px-6 py-16">
  8. <h1 className="text-3xl font-bold mb-4">Playground</h1>
  9. <p className="text-muted-foreground mb-12">
  10. Try json-render with a live example.
  11. </p>
  12. <div className="space-y-12">
  13. <section>
  14. <h2 className="text-xl font-semibold mb-4">Run locally</h2>
  15. <p className="text-sm text-muted-foreground mb-4">
  16. Clone the repository and run the example dashboard.
  17. </p>
  18. <pre className="text-sm mb-4">
  19. <code>{`git clone https://github.com/vercel-labs/json-render
  20. cd json-render
  21. pnpm install
  22. pnpm dev`}</code>
  23. </pre>
  24. <p className="text-sm text-muted-foreground">
  25. Open <code>http://localhost:3001</code> for the example dashboard.
  26. </p>
  27. </section>
  28. <section>
  29. <h2 className="text-xl font-semibold mb-4">Example prompts</h2>
  30. <p className="text-sm text-muted-foreground mb-4">
  31. Try these prompts in the example dashboard:
  32. </p>
  33. <div className="space-y-2">
  34. {[
  35. "Create a revenue dashboard with monthly metrics",
  36. "Build a user management panel with a table",
  37. "Design a settings form with text inputs",
  38. "Make a notification center with alerts",
  39. ].map((prompt) => (
  40. <div
  41. key={prompt}
  42. className="p-3 border border-border rounded text-sm font-mono"
  43. >
  44. {prompt}
  45. </div>
  46. ))}
  47. </div>
  48. </section>
  49. <section>
  50. <h2 className="text-xl font-semibold mb-4">Interactive playground</h2>
  51. <p className="text-sm text-muted-foreground mb-6">
  52. A browser-based playground is coming soon.
  53. </p>
  54. <Button variant="outline" asChild>
  55. <a
  56. href="https://github.com/vercel-labs/json-render"
  57. target="_blank"
  58. rel="noopener noreferrer"
  59. >
  60. Star on GitHub
  61. </a>
  62. </Button>
  63. </section>
  64. </div>
  65. </div>
  66. );
  67. }