import React, { useEffect } from 'react'; import { Switch } from "@/components/ui/switch"; import { Label } from "@/components/ui/label"; import { CloudUpload } from "lucide-react"; import { useSyncSettings } from '@/hooks/useSyncSettings'; import SyncStatus from '@/components/sync/SyncStatus'; import SyncExplanation from '@/components/sync/SyncExplanation'; import { isSyncEnabled } from '@/utils/sync/syncSettings'; const SyncSettings = () => { const { enabled, syncing, user, lastSync, handleSyncToggle, handleManualSync } = useSyncSettings(); // 동기화 설정 변경 모니터링 useEffect(() => { const checkSyncStatus = () => { const currentStatus = isSyncEnabled(); console.log('현재 동기화 상태:', currentStatus ? '활성화됨' : '비활성화됨'); }; // 초기 상태 확인 checkSyncStatus(); // 스토리지 변경 이벤트에도 동기화 상태 확인 추가 const handleStorageChange = () => { checkSyncStatus(); }; window.addEventListener('storage', handleStorageChange); window.addEventListener('auth-state-changed', handleStorageChange); return () => { window.removeEventListener('storage', handleStorageChange); window.removeEventListener('auth-state-changed', handleStorageChange); }; }, []); return (
여러 기기에서 예산 및 지출 데이터를 동기화합니다.