import { AlarmModel } from "@/contracts/client.schemas";
import { useTranslation } from "react-i18next";

export function useGetAlarmType() {
	const { t: contactIdTranslation } = useTranslation("contact_id");
	type ContactIdKey = (typeof contactIdTranslation.arguments)[0];

	return (alarm: AlarmModel) => {
		const code = alarm.event.code.toString();
		return contactIdTranslation(code as ContactIdKey);
	};
}
