import React, { useEffect } from 'react' import { useStore } from '@nanostores/react' import { isStandbyStore, currentTimeStore, weatherStore, showChoicesStore, showSettingsModalStore, isVisibleStore, yenBalanceStore, currentPageStore, toggleStandby, toggleShowChoices, updateTime, navigateTo } from '../stores' import { NavStrip } from './NavStrip' import { TemplatesPage } from '../pages/templates' interface VNInterfaceProps { onLogout: () => void } const NAV_ITEMS = [ { id: 'main', label: 'Main', icon: '>' }, { id: 'templates', label: 'Templates', icon: '>' } ] export function VNInterface({ onLogout }: VNInterfaceProps) { const isStandby = useStore(isStandbyStore) const currentTime = useStore(currentTimeStore) const weather = useStore(weatherStore) const showChoices = useStore(showChoicesStore) const showSettingsModal = useStore(showSettingsModalStore) const isVisible = useStore(isVisibleStore) const yenBalance = useStore(yenBalanceStore) const currentPage = useStore(currentPageStore) // Fade in effect on mount useEffect(() => { const timer = setTimeout(() => { isVisibleStore.set(true) }, 100) return () => clearTimeout(timer) }, []) // Update clock every second (Japan Time) useEffect(() => { const timer = setInterval(() => { const now = new Date() // Convert to Japan Time (UTC+9) const japanTime = new Date(now.getTime() + (now.getTimezoneOffset() * 60000) + (9 * 3600000)) updateTime() }, 1000) return () => clearInterval(timer) }, []) // Show Templates page if on templates route if (currentPage === 'templates') { return (