2025-10-15 10:24:33 +09:00
|
|
|
|
"use client";
|
|
|
|
|
|
|
|
|
|
|
|
import React from "react";
|
|
|
|
|
|
import { Button } from "@/components/ui/button";
|
2025-10-17 10:12:41 +09:00
|
|
|
|
import { Database, ArrowLeft, Save, Monitor, Smartphone } from "lucide-react";
|
2025-10-15 10:44:05 +09:00
|
|
|
|
import { ScreenResolution } from "@/types/screen";
|
2025-10-15 10:24:33 +09:00
|
|
|
|
|
|
|
|
|
|
interface SlimToolbarProps {
|
|
|
|
|
|
screenName?: string;
|
|
|
|
|
|
tableName?: string;
|
2025-10-15 10:44:05 +09:00
|
|
|
|
screenResolution?: ScreenResolution;
|
2025-10-15 10:24:33 +09:00
|
|
|
|
onBack: () => void;
|
|
|
|
|
|
onSave: () => void;
|
|
|
|
|
|
isSaving?: boolean;
|
2025-10-17 10:12:41 +09:00
|
|
|
|
onPreview?: () => void;
|
2025-10-15 10:24:33 +09:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
export const SlimToolbar: React.FC<SlimToolbarProps> = ({
|
|
|
|
|
|
screenName,
|
|
|
|
|
|
tableName,
|
2025-10-15 10:44:05 +09:00
|
|
|
|
screenResolution,
|
2025-10-15 10:24:33 +09:00
|
|
|
|
onBack,
|
|
|
|
|
|
onSave,
|
|
|
|
|
|
isSaving = false,
|
2025-10-17 10:12:41 +09:00
|
|
|
|
onPreview,
|
2025-10-15 10:24:33 +09:00
|
|
|
|
}) => {
|
|
|
|
|
|
return (
|
|
|
|
|
|
<div className="flex h-14 items-center justify-between border-b border-gray-200 bg-gradient-to-r from-gray-50 to-white px-4 shadow-sm">
|
|
|
|
|
|
{/* 좌측: 네비게이션 및 화면 정보 */}
|
|
|
|
|
|
<div className="flex items-center space-x-4">
|
|
|
|
|
|
<Button variant="ghost" size="sm" onClick={onBack} className="flex items-center space-x-2">
|
|
|
|
|
|
<ArrowLeft className="h-4 w-4" />
|
|
|
|
|
|
<span>목록으로</span>
|
|
|
|
|
|
</Button>
|
|
|
|
|
|
|
|
|
|
|
|
<div className="h-6 w-px bg-gray-300" />
|
|
|
|
|
|
|
|
|
|
|
|
<div className="flex items-center space-x-3">
|
|
|
|
|
|
<div>
|
|
|
|
|
|
<h1 className="text-lg font-semibold text-gray-900">{screenName || "화면 설계"}</h1>
|
|
|
|
|
|
{tableName && (
|
|
|
|
|
|
<div className="mt-0.5 flex items-center space-x-1">
|
|
|
|
|
|
<Database className="h-3 w-3 text-gray-500" />
|
|
|
|
|
|
<span className="font-mono text-xs text-gray-500">{tableName}</span>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
)}
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
2025-10-15 10:44:05 +09:00
|
|
|
|
|
|
|
|
|
|
{/* 해상도 정보 표시 */}
|
|
|
|
|
|
{screenResolution && (
|
|
|
|
|
|
<>
|
|
|
|
|
|
<div className="h-6 w-px bg-gray-300" />
|
|
|
|
|
|
<div className="flex items-center space-x-2 rounded-md bg-blue-50 px-3 py-1.5">
|
|
|
|
|
|
<Monitor className="h-4 w-4 text-blue-600" />
|
|
|
|
|
|
<span className="text-sm font-medium text-blue-900">{screenResolution.name}</span>
|
|
|
|
|
|
<span className="text-xs text-blue-600">
|
|
|
|
|
|
({screenResolution.width} × {screenResolution.height})
|
|
|
|
|
|
</span>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</>
|
|
|
|
|
|
)}
|
2025-10-15 10:24:33 +09:00
|
|
|
|
</div>
|
|
|
|
|
|
|
2025-10-17 10:12:41 +09:00
|
|
|
|
{/* 우측: 버튼들 */}
|
|
|
|
|
|
<div className="flex items-center space-x-2">
|
|
|
|
|
|
{onPreview && (
|
|
|
|
|
|
<Button variant="outline" onClick={onPreview} className="flex items-center space-x-2">
|
|
|
|
|
|
<Smartphone className="h-4 w-4" />
|
|
|
|
|
|
<span>반응형 미리보기</span>
|
|
|
|
|
|
</Button>
|
|
|
|
|
|
)}
|
2025-10-15 10:24:33 +09:00
|
|
|
|
<Button onClick={onSave} disabled={isSaving} className="flex items-center space-x-2">
|
|
|
|
|
|
<Save className="h-4 w-4" />
|
|
|
|
|
|
<span>{isSaving ? "저장 중..." : "저장"}</span>
|
|
|
|
|
|
</Button>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
);
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
export default SlimToolbar;
|