update
This commit is contained in:
@@ -17,14 +17,8 @@ export const CardConfig: ElementConfig = {
|
||||
label: "Subtitle",
|
||||
},
|
||||
tags: {
|
||||
type: "array",
|
||||
type: "tags",
|
||||
label: "Tags",
|
||||
arrayFields: {
|
||||
tag: {
|
||||
type: "text",
|
||||
label: "Tag",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -9,6 +9,7 @@ export type FieldType =
|
||||
| "select"
|
||||
| "image"
|
||||
| "number"
|
||||
| "tags"
|
||||
|
||||
export interface FieldOption {
|
||||
label: string
|
||||
|
||||
Reference in New Issue
Block a user