update
This commit is contained in:
@@ -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",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ export type FieldType =
|
|||||||
| "select"
|
| "select"
|
||||||
| "image"
|
| "image"
|
||||||
| "number"
|
| "number"
|
||||||
|
| "tags"
|
||||||
|
|
||||||
export interface FieldOption {
|
export interface FieldOption {
|
||||||
label: string
|
label: string
|
||||||
|
|||||||
Reference in New Issue
Block a user