decord/alpha/source/modules/chat/native/useChatWidth.tsx

79 lines
2.3 KiB
TypeScript
Raw Normal View History

2026-10-09 10:00:15 +00:00
// Module ID: 10644
// Function ID: 10645
2026-07-20 16:05:17 +00:00
// Name: useChatWidth
2026-10-09 10:00:15 +00:00
// Dependencies: [19, 4940, 4942, 10645, 558, 10646, 2]
2026-10-03 08:58:59 +00:00
// Exports: getChatWidth
2026-07-20 16:05:17 +00:00
2026-10-09 10:00:15 +00:00
// Module 10644 (useChatWidth)
import useChatLayout from "useChatLayout" /* 4940 */;
import useBaseAppContainerDimensions from "useBaseAppContainerDimensions" /* 4942 */;
import useDrawerWidth from "useDrawerWidth" /* 10645 */;
import reactDefault from "react" /* 10646 */;
2026-10-03 08:58:59 +00:00
import react from "react" /* 19 */;
import ReactCompilerGating from "ReactCompilerGating" /* 558 */;
import size from "module_2" /* 2 */;
2026-07-23 10:11:24 +00:00
const useChatLayoutDefault = useChatLayout;
const useBaseAppContainerDimensionsDefault = useBaseAppContainerDimensions;
2026-10-08 09:57:35 +00:00
const tmp2 = ReactCompilerGating.isReactCompilerEnabled() ? (function useChatWidth(arg0) {
2026-10-03 08:58:59 +00:00
let context = react.useContext(reactDefault);
const isChatLockedOpen = useChatLayoutDefault().isChatLockedOpen;
2026-08-24 06:08:38 +00:00
const width = useBaseAppContainerDimensionsDefault().width;
useDrawerWidth;
2026-07-20 16:05:17 +00:00
if (null == context) {
2026-10-03 08:58:59 +00:00
let tmp5;
2026-07-20 16:05:17 +00:00
if (null == arg0) {
let diff = width;
2026-10-03 08:58:59 +00:00
if (isChatLockedOpen) {
2026-07-20 16:05:17 +00:00
diff = width - tmp3;
}
2026-10-03 08:58:59 +00:00
tmp5 = diff;
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
tmp5 = width;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
context = tmp5;
2026-07-20 16:05:17 +00:00
}
return context;
2026-10-08 09:57:35 +00:00
}) : (function useChatWidth(arg0) {
2026-10-03 08:58:59 +00:00
let context = react.useContext(reactDefault);
const isChatLockedOpen = useChatLayoutDefault().isChatLockedOpen;
const width = useBaseAppContainerDimensionsDefault().width;
useDrawerWidth;
if (null == context) {
let tmp5;
if (null == arg0) {
let diff = width;
if (isChatLockedOpen) {
diff = width - tmp3;
}
tmp5 = diff;
} else {
tmp5 = width;
}
context = tmp5;
}
return context;
});
const result = size.fileFinishedImporting("modules/chat/native/useChatWidth.tsx");
export default tmp2;
2026-07-20 16:05:17 +00:00
export const getChatWidth = function getChatWidth(arg0) {
2026-10-03 08:58:59 +00:00
let tmp3;
2026-08-24 06:08:38 +00:00
const obj = useChatLayout;
2026-10-03 08:58:59 +00:00
const isChatLockedOpen = obj.getChatLayout().isChatLockedOpen;
const obj2 = useBaseAppContainerDimensions;
const width = obj2.getBaseAppContainerDimensions().width;
2026-07-20 16:05:17 +00:00
if (null == arg0) {
let diff = width;
2026-10-03 08:58:59 +00:00
if (isChatLockedOpen) {
const tmpResult = useDrawerWidth;
2026-10-03 08:58:59 +00:00
diff = width - tmpResult.getDrawerWidth();
2026-07-20 16:05:17 +00:00
}
2026-10-03 08:58:59 +00:00
tmp3 = diff;
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
tmp3 = width;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return tmp3;
2026-07-20 16:05:17 +00:00
};