decord/alpha/source/hooks/useTheme.tsx

74 lines
1.9 KiB
TypeScript
Raw Normal View History

2026-10-03 08:58:59 +00:00
// Module ID: 4791
// Function ID: 4792
2026-07-20 16:05:17 +00:00
// Name: useTheme
2026-10-03 08:58:59 +00:00
// Dependencies: [1085, 558, 4729, 576, 2]
// Exports: getThemeIndex
2026-07-20 16:05:17 +00:00
2026-10-03 08:58:59 +00:00
// Module 4791 (useTheme)
import react from "react" /* 576 */;
import Constants from "Constants" /* 1085 */;
import shared from "shared" /* 4729 */;
import ReactCompilerGating_mod from "ReactCompilerGating" /* 558 */;
import size from "module_2" /* 2 */;
2026-07-23 10:11:24 +00:00
const ThemeTypes = Constants.ThemeTypes;
2026-10-03 08:58:59 +00:00
let ReactCompilerGating = ReactCompilerGating_mod;
ReactCompilerGating.isReactCompilerEnabled();
const useTheme = () => {
const obj = shared;
return obj.useThemeContext().theme;
2026-07-29 08:29:29 +00:00
};
2026-10-03 08:58:59 +00:00
ReactCompilerGating = ReactCompilerGating_mod;
function getThemeIndex(arg0) {
2026-07-29 08:29:29 +00:00
if (ThemeTypes.DARK === arg0) {
return 0;
} else if (tmp.LIGHT === arg0) {
return 1;
}
2026-10-03 08:58:59 +00:00
}
const tmp3 = ReactCompilerGating.isReactCompilerEnabled() ? (() => {
const obj = react;
const cResult = obj.c(2);
if (typeof fn === "function") {
let tmp4;
const tmpResult = shared;
const theme = tmpResult.useThemeContext().theme;
if (cResult[0] !== theme) {
let num2 = 0;
if (ThemeTypes.DARK !== theme) {
if (ThemeTypes.LIGHT === theme) {
num2 = 1;
}
}
cResult[0] = theme;
cResult[1] = num2;
tmp4 = num2;
} else {
tmp4 = cResult[1];
}
return tmp4;
} else {
throw new TypeError("Trying to call a non-function");
}
}) : (() => {
if (typeof fn === "function") {
const obj = shared;
const theme = obj.useThemeContext().theme;
let num = 0;
if (ThemeTypes.DARK !== theme) {
if (ThemeTypes.LIGHT === theme) {
num = 1;
}
}
return num;
} else {
throw new TypeError("Trying to call a non-function");
}
});
const result1 = size.fileFinishedImporting("hooks/useTheme.tsx");
export default useTheme;
export { useTheme };
export const useThemeIndex = tmp3;
export { getThemeIndex };