mirror of
https://github.com/MacRimi/ProxMenux.git
synced 2026-11-01 10:22:08 +00:00
9 lines
357 B
TypeScript
9 lines
357 B
TypeScript
import useSWR from "swr"
|
|||
|
|
import { fetchApi } from "./api-config"
|
||
|
|
|
||
|
|
// Shares the dashboard's /api/platform request through the SWR cache.
|
||
|
|
export function useIsPbs(): boolean {
|
||
|
|
const { data } = useSWR<{ product: string }>("/api/platform", (url: string) => fetchApi<{ product: string }>(url), { revalidateOnFocus: false })
|
||
|
|
return data?.product === "pbs"
|
||
|
|
}
|