"use client"; import { Activity, ArrowLeft, Blocks, Box, CheckCircle2, ChevronDown, Cpu, Download, FileCode, FileDown, FileUp, FolderOpen, GraduationCap, Layers, Mic, MoveRight, Pencil, Redo2, RotateCcw, Ruler, Settings, Smartphone, Sparkles, Trophy, Undo2, SlidersHorizontal, } from "lucide-react"; import { useEffect, useRef, useState, type ChangeEvent, type KeyboardEvent, type ReactNode } from "react"; import type { AppThemePreference } from "@/lib/appTheme"; export type EnterpriseStudioMode = "3d-solid" | "push-pull" | "drawing" | "circuits" | "codeblocks" | "challenges"; interface EnterpriseTopBarProps { projectName: string; onProjectNameChange?: (name: string) => void; activeStudio: EnterpriseStudioMode; onStudioChange: (studio: EnterpriseStudioMode) => void; onBackToDashboard?: () => void; canUndo?: boolean; canRedo?: boolean; onUndo?: () => void; onRedo?: () => void; onImport?: () => void; onExport?: () => void; onOpenAR?: () => void; onStructuralTest?: () => void; onCelebration?: () => void; onOpenTutorial?: () => void; onOpenDailyChallenges?: () => void; onOpenSettings?: () => void; onOpenA11y?: () => void; onOpenAudit?: () => void; onOpenVoiceCad?: () => void; cloudBarSlot?: ReactNode; cloudSyncStatus?: "synced" | "syncing" | "offline" | "error"; lastSyncedText?: string; isDashboard?: boolean; } export function EnterpriseTopBar({ projectName, onProjectNameChange, activeStudio, onStudioChange, onBackToDashboard, canUndo = false, canRedo = false, onUndo, onRedo, onImport, onExport, onOpenAR, onStructuralTest, onCelebration, onOpenTutorial, onOpenDailyChallenges, onOpenSettings, onOpenA11y, onOpenAudit, onOpenVoiceCad, cloudBarSlot, cloudSyncStatus = "synced", lastSyncedText = "Az önce eşitlendi", isDashboard = false, }: EnterpriseTopBarProps) { const [editingTitle, setEditingTitle] = useState(false); const [titleDraft, setTitleDraft] = useState(projectName); const titleInputRef = useRef(null); useEffect(() => { setTitleDraft(projectName); }, [projectName]); const handleStartTitleEdit = () => { setEditingTitle(true); setTimeout(() => titleInputRef.current?.focus(), 50); }; const handleCommitTitle = () => { setEditingTitle(false); const trimmed = titleDraft.trim(); if (trimmed && trimmed !== projectName) { onProjectNameChange?.(trimmed); } else { setTitleDraft(projectName); } }; const handleTitleKeyDown = (e: KeyboardEvent) => { if (e.key === "Enter") { handleCommitTitle(); } else if (e.key === "Escape") { setEditingTitle(false); setTitleDraft(projectName); } }; return (
{/* 1. Sol: Marka ve Proje Başlığı */}
{onBackToDashboard ? ( ) : null}
SnapCAD Studio YakHub Kurumsal Tasarım Platformu
{!isDashboard ? (
{editingTitle ? ( setTitleDraft(e.target.value)} onBlur={handleCommitTitle} onKeyDown={handleTitleKeyDown} maxLength={80} aria-label="Proje Adını Düzenle" /> ) : ( )} {/* Bulut Durumu İndikatörü */}
) : null}
{/* 2. Orta: Stüdyo Değiştirici (Studio Switcher Pills) */} {/* 3. Sağ: Hızlı Eylemler, YakNet SSO Menüsü ve Erişilebilirlik */}
{!isDashboard ? (
{/* Geri Al / İleri Al */}
{/* İçe Aktar & Dışa Aktar */} {onOpenAR ? ( ) : null} {onStructuralTest ? ( ) : null} {onCelebration ? ( ) : null} {onOpenDailyChallenges ? ( ) : null} {onOpenTutorial ? ( ) : null}
) : null} {/* YakNet Account Widget & Cloud Bar */}
{cloudBarSlot}
{/* Erişilebilirlik ve Ayarlar Butonu */} {onOpenA11y ? ( ) : null} {/* Görme Engelli & Ekran Okuyucu Dostu İşitsel Sahne Denetçisi */} {onOpenAudit ? ( ) : null} {/* SnapVoice — Sesli ve Komutlu CAD Asistanı */} {onOpenVoiceCad ? ( ) : null}
); }