
import { useState, useEffect } from 'react';
import { useAuth } from '@/contexts/auth';
import { useSyncToggle } from './sync/useSyncToggle';
import { useManualSync } from './sync/useManualSync';
import { useSyncStatus } from './sync/useSyncStatus';

/**
 * 동기화 설정 관리를 위한 커스텀 훅
 */
export const useSyncSettings = () => {
  const { user } = useAuth();
  const { enabled, setEnabled, handleSyncToggle } = useSyncToggle();
  const { syncing, handleManualSync } = useManualSync(user);
  const { lastSync, formatLastSyncTime } = useSyncStatus();

  return {
    enabled,
    syncing,
    user,
    lastSync: formatLastSyncTime(),
    handleSyncToggle,
    handleManualSync,
  };
};
