import { useEffect, useState } from 'react' import { useStore, wireEvents } from './store' import { useT } from './i18n' import { Onboarding } from './components/Onboarding' import { ProfileManager } from './components/ProfileManager' import { AnniversaryManager } from './components/AnniversaryManager' import { FolderPicker } from './components/FolderPicker' import { RunControl } from './components/RunControl' import { ProgressView } from './components/ProgressView' import { FileList } from './components/FileList' import { ReportView } from './components/ReportView' import { LibraryView } from './components/LibraryView' import { SearchView } from './components/SearchView' import { GroupsView } from './components/GroupsView' import { MapView } from './components/MapView' import { FileExplorer } from './components/FileExplorer' import { Overlays } from './overlays' import type { AppView } from './store' export default function App(): JSX.Element { const t = useT() const phase = useStore((s) => s.phase) const view = useStore((s) => s.view) const setView = useStore((s) => s.setView) const easyMode = useStore((s) => s.easyMode) const onboarded = useStore((s) => s.onboarded) const refreshProfiles = useStore((s) => s.refreshProfiles) const initSettings = useStore((s) => s.initSettings) const [ready, setReady] = useState(false) useEffect(() => { const unwire = wireEvents() // 설정 로드(테마 적용 포함) 후 화면 표시 void initSettings().then(() => setReady(true)) void refreshProfiles() return unwire }, [refreshProfiles, initSettings]) if (!ready) return
if (!onboarded) return const tabs: { id: AppView; label: string; easyLabel: string; icon: string }[] = [ { id: 'organize', label: t('nav.organize'), easyLabel: t('easynav.organize'), icon: '📂' }, { id: 'library', label: t('nav.library'), easyLabel: t('easynav.library'), icon: '🖼️' }, { id: 'search', label: t('nav.search'), easyLabel: t('easynav.search'), icon: '🔍' }, { id: 'map', label: t('nav.map'), easyLabel: t('easynav.map'), icon: '🗺️' }, { id: 'groups', label: t('nav.groups'), easyLabel: t('easynav.groups'), icon: '🧹' } ] return (
{easyMode ? ( /* 쉬운 모드: 대형 아이콘+구어체 버튼 네비 */
) : ( /* darktable식 컴팩트 상단바: 좌측 로고 · 우측 파이프 구분 탭 */
photoai
)} {view === 'organize' ? (
{/* 좌측: 파일 탐색기 사이드바 */}
{/* 설정 패널 (자체 스크롤) */}
{/* 진행/결과 — FileList만 내부 스크롤 */}
{phase === 'done' ? : }
) : view === 'library' ? (
) : view === 'search' ? (
) : view === 'map' ? (
) : (
)} {/* 토스트 / 확인 모달 호스트 (전역) */}
) }