"use client"; import { useState } from "react"; import { DriverManagementConfig } from "../types"; import { Button } from "@/components/ui/button"; import { Label } from "@/components/ui/label"; import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select"; import { Switch } from "@/components/ui/switch"; import { Input } from "@/components/ui/input"; import { Card } from "@/components/ui/card"; import { COLUMN_LABELS, DEFAULT_VISIBLE_COLUMNS } from "./driverUtils"; interface DriverManagementSettingsProps { config: DriverManagementConfig; onSave: (config: DriverManagementConfig) => void; onClose: () => void; } export function DriverManagementSettings({ config, onSave, onClose }: DriverManagementSettingsProps) { const [localConfig, setLocalConfig] = useState(config); const handleSave = () => { onSave(localConfig); }; // 컬럼 토글 const toggleColumn = (column: string) => { const newColumns = localConfig.visibleColumns.includes(column) ? localConfig.visibleColumns.filter((c) => c !== column) : [...localConfig.visibleColumns, column]; setLocalConfig({ ...localConfig, visibleColumns: newColumns }); }; return (
{/* 자동 새로고침 */}
{/* 정렬 설정 */}
{/* 표시 컬럼 선택 */}
{Object.entries(COLUMN_LABELS).map(([key, label]) => ( toggleColumn(key)} >
toggleColumn(key)} />
))}
{/* 푸터 - 고정 */}
); }