import { useQuery } from '@tanstack/react-query';

import { useStores } from '@/app/(root)/AppProviders';

// TODO: this is a temporary hook that currently only loads clips on page load. meant to be for de-duping the library clips loading logic, the bulk of the library clip
// store management is handled in libraryStore
export const useLibraryClips = () => {
  const { library } = useStores();
  return useQuery({
    queryKey: ['library-clips'],
    queryFn: async () => {
      await library.loadClips();
    },
  });
};
