"use client";

import { getCookie } from "cookies-next";
import { useSyncExternalStore } from "react";
import { SALON_GENDER_COOKIE } from "@/components/gender-select/gender-select";

function subscribe() {
  return () => undefined;
}

function getGenderSnapshot() {
  return (getCookie(SALON_GENDER_COOKIE) as string | undefined) || undefined;
}

/** جنسیت انتخاب‌شده از کوکی (۱ آقایان / ۲ خانم‌ها) */
export function useSalonGender() {
  return useSyncExternalStore(subscribe, getGenderSnapshot, () => undefined);
}
