"use client"; import { PopComponentRegistry } from "../../PopComponentRegistry"; import { PopSearchComponent } from "./PopSearchComponent"; import { PopSearchConfigPanel } from "./PopSearchConfig"; import type { PopSearchConfig } from "./types"; const defaultConfig: PopSearchConfig = { inputType: "text", fieldName: "", placeholder: "검색어 입력", debounceMs: 500, triggerOnEnter: true, labelPosition: "top", labelText: "", labelVisible: true, }; function PopSearchPreviewComponent({ config, label }: { config?: PopSearchConfig; label?: string }) { const cfg = config || defaultConfig; const displayLabel = label || cfg.fieldName || "검색"; return (
{displayLabel}
{cfg.placeholder || cfg.inputType}
); } PopComponentRegistry.registerComponent({ id: "pop-search", name: "검색", description: "조건 입력 (텍스트/날짜/선택/모달)", category: "input", icon: "Search", component: PopSearchComponent, configPanel: PopSearchConfigPanel, preview: PopSearchPreviewComponent, defaultProps: defaultConfig, touchOptimized: true, supportedDevices: ["mobile", "tablet"], });