import { useQuery } from "@tanstack/react-query";
import { apiGet } from "../lib/api";

export interface Tag {
	id: number;
	name: string;
}

export function useTags() {
	return useQuery({
		queryKey: ["tags"],
		queryFn: () => apiGet<Tag[]>("/api/tags"),
		staleTime: 5 * 60 * 1000,
	});
}
