decord/alpha/source/hooks/useTheme.tsx

74 lines
1.9 KiB
TypeScript
Raw Normal View History

2026-10-08 09:57:35 +00:00
// Module ID: 4991
// Function ID: 4992
2026-07-20 16:05:17 +00:00
// Name: useTheme
2026-10-08 09:57:35 +00:00
// Dependencies: [1085, 558, 4929, 576, 2]
2026-10-03 08:58:59 +00:00
// Exports: getThemeIndex
2026-07-20 16:05:17 +00:00
2026-10-08 09:57:35 +00:00
// Module 4991 (useTheme)
2026-10-03 08:58:59 +00:00
import react from "react" /* 576 */;
import Constants from "Constants" /* 1085 */;
2026-10-08 09:57:35 +00:00
import shared from "shared" /* 4929 */;
2026-10-03 08:58:59 +00:00
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();
2026-10-08 09:57:35 +00:00
function useTheme() {
2026-10-03 08:58:59 +00:00
const obj = shared;
return obj.useThemeContext().theme;
2026-10-08 09:57:35 +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
}
2026-10-08 09:57:35 +00:00
const tmp3 = ReactCompilerGating.isReactCompilerEnabled() ? (function useThemeIndex() {
2026-10-03 08:58:59 +00:00
const obj = react;
const cResult = obj.c(2);
2026-10-08 09:57:35 +00:00
if (typeof useTheme === "function") {
2026-10-03 08:58:59 +00:00
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");
}
2026-10-08 09:57:35 +00:00
}) : (function useThemeIndex() {
if (typeof useTheme === "function") {
2026-10-03 08:58:59 +00:00
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 };