import { useGetZoneList } from "@/contracts/zones";

export function useGetZoneName(assetId: string, zoneIndex?: number) {
	const { data, isLoading, isError } = useGetZoneList({
		AssetId: assetId,
	});

	if (isLoading || isError) {
		return "-";
	}

	return data?.items.find((x) => x.index === zoneIndex)?.name ?? "-";
}
