This commit is contained in:
Rami Bitar
2026-06-09 17:06:15 -04:00
parent 1ebe68efeb
commit 98dd7741a0
3 changed files with 6 additions and 15 deletions

View File

@@ -17,14 +17,8 @@ export const CardConfig: ElementConfig = {
label: "Subtitle", label: "Subtitle",
}, },
tags: { tags: {
type: "array", type: "tags",
label: "Tags", label: "Tags",
arrayFields: {
tag: {
type: "text",
label: "Tag",
},
},
}, },
}, },
}, },

View File

@@ -10,15 +10,11 @@ import { cn } from "@/lib/utils"
import { Image } from "./Image" import { Image } from "./Image"
import { Typography } from "./Typography" import { Typography } from "./Typography"
export interface CardTag {
tag: string
}
export interface CardProps extends React.ComponentProps<typeof ShadcnCard> { export interface CardProps extends React.ComponentProps<typeof ShadcnCard> {
image?: string image?: string
title?: string title?: string
subtitle?: string subtitle?: string
tags?: CardTag[] tags?: string[]
} }
function Card({ function Card({
@@ -58,9 +54,9 @@ function Card({
{tags && tags.length > 0 ? ( {tags && tags.length > 0 ? (
<CardContent className="flex flex-wrap gap-2"> <CardContent className="flex flex-wrap gap-2">
{tags.map((item, index) => ( {tags.map((tag, index) => (
<Badge key={`${item.tag}-${index}`} variant="secondary"> <Badge key={`${tag}-${index}`} variant="secondary">
{item.tag} {tag}
</Badge> </Badge>
))} ))}
</CardContent> </CardContent>

View File

@@ -9,6 +9,7 @@ export type FieldType =
| "select" | "select"
| "image" | "image"
| "number" | "number"
| "tags"
export interface FieldOption { export interface FieldOption {
label: string label: string