Skip to content

A local-first personal finance app

283 B
Raw Blame
import { useQuery } from '@tanstack/react-query';

import { reportQueries } from '#reports';

export function useReport(id?: string | null) {
  return useQuery({
    ...reportQueries.list(),
    select: reports => reports.find(report => report.id === id),
    enabled: !!id,
  });
}