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",
},
tags: {
type: "array",
type: "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 { Typography } from "./Typography"
export interface CardTag {
tag: string
}
export interface CardProps extends React.ComponentProps<typeof ShadcnCard> {
image?: string
title?: string
subtitle?: string
tags?: CardTag[]
tags?: string[]
}
function Card({
@@ -58,9 +54,9 @@ function Card({
{tags && tags.length > 0 ? (
<CardContent className="flex flex-wrap gap-2">
{tags.map((item, index) => (
<Badge key={`${item.tag}-${index}`} variant="secondary">
{item.tag}
{tags.map((tag, index) => (
<Badge key={`${tag}-${index}`} variant="secondary">
{tag}
</Badge>
))}
</CardContent>

View File

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