import { useGetAreaList } from "@/contracts/areas";

export function useGetAreaName(assetId: string, areaIndex?: number) {
	const { data, isLoading, isError } = useGetAreaList({
		AssetId: assetId,
	});

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

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