diff --git a/components/elements/Card.config.tsx b/components/elements/Card.config.tsx index 30917a7..6ecca19 100644 --- a/components/elements/Card.config.tsx +++ b/components/elements/Card.config.tsx @@ -17,14 +17,8 @@ export const CardConfig: ElementConfig = { label: "Subtitle", }, tags: { - type: "array", + type: "tags", label: "Tags", - arrayFields: { - tag: { - type: "text", - label: "Tag", - }, - }, }, }, }, diff --git a/components/elements/Card.tsx b/components/elements/Card.tsx index 7cc5616..4779522 100644 --- a/components/elements/Card.tsx +++ b/components/elements/Card.tsx @@ -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 { image?: string title?: string subtitle?: string - tags?: CardTag[] + tags?: string[] } function Card({ @@ -58,9 +54,9 @@ function Card({ {tags && tags.length > 0 ? ( - {tags.map((item, index) => ( - - {item.tag} + {tags.map((tag, index) => ( + + {tag} ))} diff --git a/components/elements/types.ts b/components/elements/types.ts index cccf816..69cef77 100644 --- a/components/elements/types.ts +++ b/components/elements/types.ts @@ -9,6 +9,7 @@ export type FieldType = | "select" | "image" | "number" + | "tags" export interface FieldOption { label: string