@wener/console
Version:
Base console UI toolkit
24 lines (23 loc) • 635 B
JavaScript
import { useStore } from "zustand";
import { getWindowStyleStore } from "./WindowStyleStore.js";
export function useWindowTheme() {
var theme = useStore(getWindowStyleStore(), function (s) {
return s.theme;
});
if (theme && theme !== "system") {
return theme;
}
var ua = navigator.userAgent;
if (ua.indexOf("Win") !== -1) {
return "windows";
}
else if (ua.indexOf("Mac") !== -1) {
return "macos";
}
// if (ua.indexOf('Linux') !== -1 || ua.indexOf('X11') !== -1) {
// return 'linux';
// } else {
// return 'unknown';
// }
return "macos";
}