import { useCallback } from "react"; import { goalsApi } from "../api/goals"; import { useApi } from "../hooks/useApi"; import { cn } from "../lib/utils"; const levelColors: Record = { company: "bg-purple-100 text-purple-800", team: "bg-blue-100 text-blue-800", agent: "bg-indigo-100 text-indigo-800", task: "bg-gray-100 text-gray-600", }; export function Goals() { const fetcher = useCallback(() => goalsApi.list(), []); const { data: goals, loading, error } = useApi(fetcher); return (

Goals

{loading &&

Loading...

} {error &&

{error.message}

} {goals && goals.length === 0 &&

No goals yet.

} {goals && goals.length > 0 && (
{goals.map((goal) => (

{goal.title}

{goal.description && (

{goal.description}

)}
{goal.level}
))}
)}
); }