// AUTO-GENERATED by stele — do not edit.
// React / React Native hooks bound to the locale store. Calling setLocale
// anywhere (see the store module) re-renders every useStele() consumer. There's
// no Provider to mount — the store is the single source of truth.
import { useSyncExternalStore } from "react";
import {
  getStele,
  getLocale,
  setLocale,
  subscribeLocale,
  isFollowingDevice,
  type Stele,
  type Locale,
} from "./stele.store";

export function useStele(): Stele {
  return useSyncExternalStore(subscribeLocale, getStele, getStele);
}

export function useLocale(): [Locale, (locale: Locale) => void] {
  const locale = useSyncExternalStore(subscribeLocale, getLocale, getLocale);
  return [locale, setLocale];
}

/** Whether the active locale is following the device (for a "System" toggle). */
export function useFollowingDevice(): boolean {
  return useSyncExternalStore(
    subscribeLocale,
    isFollowingDevice,
    isFollowingDevice,
  );
}
