From d8af78ec3b3fa02c162c191453f96242dfe59b65 Mon Sep 17 00:00:00 2001 From: Guilherme de Andrade Date: Mon, 19 Jan 2026 17:53:04 +0000 Subject: [PATCH] fix: fix button actions on dashboard example --- examples/dashboard/app/api/generate/route.ts | 2 +- examples/dashboard/components/ui/button.tsx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/dashboard/app/api/generate/route.ts b/examples/dashboard/app/api/generate/route.ts index 1e5d1c67..44478026 100644 --- a/examples/dashboard/app/api/generate/route.ts +++ b/examples/dashboard/app/api/generate/route.ts @@ -15,7 +15,7 @@ COMPONENT DETAILS: - Metric: { label: string, valuePath: string, format?: "number"|"currency"|"percent", trend?: "up"|"down"|"neutral", trendValue?: string } - Chart: { type: "bar"|"line"|"pie"|"area", dataPath: string, title?: string, height?: number } - Table: { dataPath: string, columns: [{ key: string, label: string, format?: "text"|"currency"|"date"|"badge" }] } -- Button: { label: string, action: string, variant?: "primary"|"secondary"|"danger"|"ghost" } +- Button: { label: string, action: "export_report"|"refresh_data"|"view_details"|"apply_filter", variant?: "primary"|"secondary"|"danger"|"ghost" } - Heading: { text: string, level?: "h1"|"h2"|"h3"|"h4" } - Text: { content: string, variant?: "body"|"caption"|"label", color?: "default"|"muted"|"success"|"warning"|"danger" } - Badge: { text: string, variant?: "default"|"success"|"warning"|"danger"|"info" } diff --git a/examples/dashboard/components/ui/button.tsx b/examples/dashboard/components/ui/button.tsx index e36b7d0a..f56a8a3d 100644 --- a/examples/dashboard/components/ui/button.tsx +++ b/examples/dashboard/components/ui/button.tsx @@ -7,7 +7,7 @@ export function Button({ element, onAction, loading }: ComponentRenderProps) { const { label, variant, action, disabled } = element.props as { label: string; variant?: string | null; - action: { name: string }; + action: string; disabled?: boolean | null; }; @@ -28,7 +28,7 @@ export function Button({ element, onAction, loading }: ComponentRenderProps) { return (