"use client"; /** * pop-card-list-v2 디자인 모드 미리보기 * * 디자이너 캔버스에서 표시되는 미리보기. * CSS Grid 기반 셀 배치를 시각적으로 보여준다. */ import React from "react"; import { LayoutGrid, Package } from "lucide-react"; import type { PopCardListV2Config } from "../types"; import { CARD_SCROLL_DIRECTION_LABELS, CARD_SIZE_LABELS } from "../types"; interface PopCardListV2PreviewProps { config?: PopCardListV2Config; } export function PopCardListV2PreviewComponent({ config }: PopCardListV2PreviewProps) { const scrollDirection = config?.scrollDirection || "vertical"; const cardSize = config?.cardSize || "medium"; const dataSource = config?.dataSource; const cardGrid = config?.cardGrid; const hasTable = !!dataSource?.tableName; const cellCount = cardGrid?.cells?.length || 0; return (
카드 목록 V2
{CARD_SCROLL_DIRECTION_LABELS[scrollDirection]} {CARD_SIZE_LABELS[cardSize]}
{!hasTable ? (

데이터 소스를 설정하세요

) : ( <>
{dataSource!.tableName} ({cellCount}셀)
{[0, 1].map((cardIdx) => (
{cellCount === 0 ? (
셀을 추가하세요
) : (
w || "1fr").join(" ") : `repeat(${cardGrid!.cols || 1}, 1fr)`, gridTemplateRows: `repeat(${cardGrid!.rows || 1}, minmax(16px, auto))`, gap: "2px", }} > {cardGrid!.cells.map((cell) => (
{cell.type} {cell.columnName ? `: ${cell.columnName}` : ""}
))}
)}
))}
)}
); }