import { useContext } from "react"; import { DeviceProviderContext } from "./DeviceProvider"; export function useDeviceId(): string { const context = useContext(DeviceProviderContext); if(!context) { throw new Error("useDeviceId must be used within a DeviceProvider"); } return context.deviceId; }