"use client"; import React, { useState, useEffect } from "react"; import { Moon, Sun } from "lucide-react"; import { Equipment, Process, ProductionType } from "./types"; interface PopHeaderProps { currentDateTime: Date; productionType: ProductionType; selectedEquipment: Equipment | null; selectedProcess: Process | null; showMyWorkOnly: boolean; theme: "dark" | "light"; onProductionTypeChange: (type: ProductionType) => void; onEquipmentClick: () => void; onProcessClick: () => void; onMyWorkToggle: () => void; onSearchClick: () => void; onSettingsClick: () => void; onThemeToggle: () => void; } export function PopHeader({ currentDateTime, productionType, selectedEquipment, selectedProcess, showMyWorkOnly, theme, onProductionTypeChange, onEquipmentClick, onProcessClick, onMyWorkToggle, onSearchClick, onSettingsClick, onThemeToggle, }: PopHeaderProps) { const [mounted, setMounted] = useState(false); useEffect(() => { setMounted(true); }, []); const formatDate = (date: Date) => { const year = date.getFullYear(); const month = String(date.getMonth() + 1).padStart(2, "0"); const day = String(date.getDate()).padStart(2, "0"); return `${year}-${month}-${day}`; }; const formatTime = (date: Date) => { const hours = String(date.getHours()).padStart(2, "0"); const minutes = String(date.getMinutes()).padStart(2, "0"); return `${hours}:${minutes}`; }; return (
{/* 1행: 날짜/시간 + 테마 토글 + 작업지시/원자재 */}
{mounted ? formatDate(currentDateTime) : "----.--.--"} {mounted ? formatTime(currentDateTime) : "--:--"}
{/* 테마 토글 버튼 */}
{/* 2행: 필터 버튼들 */}
); }