decord/source/modules/search/native/hooks/useSearchContext.tsx

53 lines
2.1 KiB
TypeScript
Raw Normal View History

2026-07-25 08:10:48 +00:00
// Module ID: 10039
2026-07-27 11:26:19 +00:00
// Function ID: 77592
2026-07-20 16:05:17 +00:00
// Name: getChannelDetailsSearchContext
2026-07-23 10:11:24 +00:00
// Dependencies: [31, 1348, 653, 44, 624, 2]
2026-07-20 16:05:17 +00:00
// Exports: useChannelDetailsSearchContext, useGuildChannelSearchContext, useGuildSearchContext
2026-07-25 08:10:48 +00:00
// Module 10039 (getChannelDetailsSearchContext)
2026-07-23 10:11:24 +00:00
import result from "result";
import _isNativeReflectConstruct from "_isNativeReflectConstruct";
import { SearchTypes } from "ME";
const require = arg1;
2026-07-20 16:05:17 +00:00
function getChannelDetailsSearchContext(channelId, guildId, isThreadResult) {
if (isThreadResult) {
2026-07-23 10:11:24 +00:00
importDefault(44)(null != guildId, "[useChannelDetailsSearchContext] Thread must have a guild id");
2026-07-20 16:05:17 +00:00
let obj = { type: SearchTypes.THREAD, guildId, channelId };
} else if (null == guildId) {
obj = { type: SearchTypes.CHANNEL, channelId };
} else {
obj = { type: SearchTypes.GUILD_CHANNEL, guildId, channelId };
}
return obj;
}
2026-07-23 10:11:24 +00:00
const result = require("ME").fileFinishedImporting("modules/search/native/hooks/useSearchContext.tsx");
2026-07-20 16:05:17 +00:00
export const useGuildSearchContext = function useGuildSearchContext(guildId) {
2026-07-23 10:11:24 +00:00
let closure_0 = guildId;
2026-07-20 16:05:17 +00:00
const items = [guildId];
2026-07-23 10:11:24 +00:00
return React.useMemo(() => ({ type: outer1_5.GUILD, guildId: closure_0 }), items);
2026-07-20 16:05:17 +00:00
};
export const useGuildChannelSearchContext = function useGuildChannelSearchContext(arg0, arg1) {
2026-07-23 10:11:24 +00:00
let closure_0 = arg0;
let closure_1 = arg1;
2026-07-20 16:05:17 +00:00
const items = [arg0, arg1];
2026-07-23 10:11:24 +00:00
return React.useMemo(() => ({ type: outer1_5.GUILD_CHANNEL, guildId: closure_0, channelId: closure_1 }), items);
2026-07-20 16:05:17 +00:00
};
export { getChannelDetailsSearchContext };
export const useChannelDetailsSearchContext = function useChannelDetailsSearchContext(channelId, guildId) {
2026-07-23 10:11:24 +00:00
const _require = channelId;
let closure_1 = guildId;
const items = [_isNativeReflectConstruct];
stateFromStores = _require(stateFromStores[4]).useStateFromStores(items, () => {
const channel = outer1_4.getChannel(closure_0);
2026-07-20 16:05:17 +00:00
let isThreadResult;
if (null != channel) {
isThreadResult = channel.isThread();
}
return null != isThreadResult && isThreadResult;
});
const items1 = [channelId, guildId, stateFromStores];
2026-07-23 10:11:24 +00:00
return React.useMemo(() => outer1_6(closure_0, closure_1, stateFromStores), items1);
2026-07-20 16:05:17 +00:00
};