import { useQuery } from '@tanstack/react-query';
import { getPublicSettings, PublicSettings } from '../services/settings';

export const usePublicSettings = () =>
  useQuery<PublicSettings>({
    queryKey: ['public-settings'],
    queryFn: getPublicSettings,
    staleTime: 10 * 60 * 1000, // 10 minutes - settings don't change often
    cacheTime: 30 * 60 * 1000, // 30 minutes - keep in cache longer
    refetchOnWindowFocus: false,
    refetchOnMount: false,
  });
