generation-modes-diagram.tsx 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. "use client";
  2. function Skeleton({ className = "" }: { className?: string }) {
  3. return <div className={`rounded bg-muted-foreground/10 ${className}`} />;
  4. }
  5. /** Simple form wireframe reused in both diagrams */
  6. function FormUI() {
  7. return (
  8. <div className="border border-border rounded-lg p-2.5 space-y-1.5 bg-muted/30">
  9. {/* Title */}
  10. <Skeleton className="h-2.5 w-14 mb-1" />
  11. {/* Input fields */}
  12. <Skeleton className="h-4 w-full rounded-sm" />
  13. <Skeleton className="h-4 w-full rounded-sm" />
  14. {/* Submit button */}
  15. <Skeleton className="h-4 w-16 rounded-sm bg-muted-foreground/20 mt-1" />
  16. </div>
  17. );
  18. }
  19. function InlineModeDiagram() {
  20. return (
  21. <div className="flex flex-col h-full">
  22. <div className="text-xs font-medium text-muted-foreground mb-3 text-center">
  23. Inline Mode
  24. </div>
  25. <div className="flex-1 border border-border rounded-lg bg-background overflow-hidden flex flex-col">
  26. {/* Chat area */}
  27. <div className="flex-1 p-3 overflow-hidden flex justify-center">
  28. <div className="w-1/3 min-w-[120px] space-y-3">
  29. {/* User message */}
  30. <div className="flex justify-end">
  31. <div className="bg-muted rounded-xl px-3 py-2">
  32. <Skeleton className="h-2 w-14" />
  33. </div>
  34. </div>
  35. {/* Assistant text */}
  36. <div className="space-y-2">
  37. <div className="space-y-1.5">
  38. <Skeleton className="h-2 w-full" />
  39. <Skeleton className="h-2 w-3/4" />
  40. </div>
  41. {/* Inline UI */}
  42. <FormUI />
  43. {/* More text after UI */}
  44. <div className="space-y-1.5">
  45. <Skeleton className="h-2 w-4/5" />
  46. </div>
  47. </div>
  48. </div>
  49. </div>
  50. {/* Input bar */}
  51. <div className="p-2 flex justify-center">
  52. <div className="w-1/3 min-w-[120px] flex items-center gap-2">
  53. <Skeleton className="h-7 flex-1 rounded-md" />
  54. <Skeleton className="h-7 w-7 rounded-md" />
  55. </div>
  56. </div>
  57. </div>
  58. <div className="text-[10px] text-muted-foreground/60 mt-2 text-center">
  59. Text + UI interleaved in messages
  60. </div>
  61. </div>
  62. );
  63. }
  64. function StandaloneModeDiagram() {
  65. return (
  66. <div className="flex flex-col h-full">
  67. <div className="text-xs font-medium text-muted-foreground mb-3 text-center">
  68. Standalone Mode
  69. </div>
  70. <div className="flex-1 border border-border rounded-lg bg-background overflow-hidden flex flex-row">
  71. {/* Left panel - prompt */}
  72. <div className="w-[38%] border-r border-border flex flex-col">
  73. <div className="flex-1" />
  74. <div className="p-3 space-y-2">
  75. <Skeleton className="h-7 w-full rounded-md" />
  76. <Skeleton className="h-5 w-16 rounded-md" />
  77. </div>
  78. </div>
  79. {/* Right panel - UI preview */}
  80. <div className="flex-1 p-3 flex items-center justify-center">
  81. <div className="w-3/4">
  82. <FormUI />
  83. </div>
  84. </div>
  85. </div>
  86. <div className="text-[10px] text-muted-foreground/60 mt-2 text-center">
  87. Prompt separate from UI preview
  88. </div>
  89. </div>
  90. );
  91. }
  92. export function GenerationModesDiagram() {
  93. return (
  94. <div className="not-prose my-8">
  95. <div className="grid grid-cols-1 sm:grid-cols-2 gap-6">
  96. <div className="h-[280px]">
  97. <InlineModeDiagram />
  98. </div>
  99. <div className="h-[280px]">
  100. <StandaloneModeDiagram />
  101. </div>
  102. </div>
  103. </div>
  104. );
  105. }