feat(api): implement precomputed widget data storage and retrieval.

This commit is contained in:
shay
2026-04-18 11:13:43 -04:00
parent f0c6edacf6
commit 79b9c31197
7 changed files with 207 additions and 94 deletions
@@ -85,6 +85,8 @@ type Props = {
onGenerate: () => void
onBack: () => void
fetchDone: boolean
fetchError: string | null
isDemo: boolean
widgetData: WidgetData | null
}
@@ -95,6 +97,8 @@ export function WorkshopScreen({
onGenerate,
onBack,
fetchDone,
fetchError,
isDemo,
widgetData,
}: Props) {
const [expandedWidget, setExpandedWidget] = useState<string | null>(null)
@@ -175,7 +179,17 @@ export function WorkshopScreen({
<div className="text-sm font-semibold text-gray-800 mb-1">{username}</div>
<div className="flex items-center gap-1.5 text-[10px] text-gray-400 mb-6">
{fetchDone ? (
{fetchError ? (
<>
<div className="w-1.5 h-1.5 rounded-full bg-red-400" />
{fetchError}
</>
) : isDemo ? (
<>
<div className="w-1.5 h-1.5 rounded-full bg-amber-400 animate-pulse" />
Building your widget — showing demo
</>
) : fetchDone ? (
<>
<div className="w-1.5 h-1.5 rounded-full bg-emerald-400" />
Data ready