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

import { WorkspacesService } from '@/client/services/WorkspacesService';

export function useWorkspaceList() {
  return useQuery({
    queryKey: ['workspaces', 'list'],
    queryFn: () => WorkspacesService.workspaceList({}).then((r) => r.data),
    staleTime: 1000 * 60 * 5,
  });
}
