import { Hall } from "@/app/[language]/hall/type"; import { useHallStore } from "@/store/Stores"; import { GetHallAPI } from "@/type/wwwAPI"; import { formatText } from "@/utilities/Utility"; import { wwwAPI } from "@/utilities/wwwAPI"; import { useQuery } from "@tanstack/react-query"; import { useIsPath } from "taehui-ts/fe-utilities"; export default function useGetAbility9KHall() { const { tabPosition, abilityTabPosition } = useHallStore(); const isPath = useIsPath(); return useQuery<Hall[]>({ enabled: tabPosition === 2 && abilityTabPosition === 2 && isPath("/hall"), queryKey: ["ability9KHall"], queryFn: async () => { const { data } = await wwwAPI.get<GetHallAPI[]>("/hall/ability/9K"); return data.map((hall) => ({ ...hall, text: `${formatText(hall.value)} Point`, })); }, initialData: [], }); }