All files / packages/app/components all-debts-group.tsx

100% Statements 4/4
100% Branches 0/0
100% Functions 1/1
100% Lines 4/4

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22                      21x       351x 351x 351x        
import React from "react";
 
import { useSuspenseQuery } from "@tanstack/react-query";
 
import {
	DebtsGroup,
	DebtsGroupSkeleton,
} from "~app/components/app/debts-group";
import { suspendedFallback } from "~app/components/suspense-wrapper";
import { useTRPC } from "~app/utils/trpc";
 
export const AllDebtsGroup = suspendedFallback<
	Omit<React.ComponentProps<typeof DebtsGroup>, "debts">
>(
	(props) => {
		const trpc = useTRPC();
		const { data: debts } = useSuspenseQuery(trpc.debts.getAll.queryOptions());
		return <DebtsGroup debts={debts.items} {...props} />;
	},
	<DebtsGroupSkeleton amount={3} />,
);