Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/dashboard/app/api/generate/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
Expand Down
4 changes: 2 additions & 2 deletions examples/dashboard/components/ui/button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};

Expand All @@ -28,7 +28,7 @@ export function Button({ element, onAction, loading }: ComponentRenderProps) {

return (
<button
onClick={() => !disabled && action && onAction?.(action)}
onClick={() => !disabled && action && onAction?.({ name: action })}
disabled={!!disabled || loading}
style={{
padding: "8px 16px",
Expand Down