import { useQuery } from "@/api/useQuery";

export default function NutrientsTable() {
  const { data, isLoading, error } = useQuery<{ id: string; name: string; description: string }[]>({
    queryKey: "/nutrient/get-all",
  });
  return (
    <div>
      <h1>Nutrients</h1>
      {data?.map((nutrient) => (
        <div key={nutrient.id}>
          <h2>{nutrient.name}</h2>
          <p>{nutrient.description}</p>
        </div>
      ))}
    </div>
  );
}
