decord/beta/source/modules/interaction_components/StringSelectActionComponentUtils.tsx

30 lines
1.2 KiB
TypeScript
Raw Normal View History

2026-10-12 16:32:48 +00:00
// Module ID: 8257
// Function ID: 8258
// Name: StringSelectActionComponentUtils
2026-10-12 16:32:48 +00:00
// Dependencies: [8251, 1998, 2]
// Exports: getInitialStringSelectOptions
2026-10-12 16:32:48 +00:00
// Module 8257 (StringSelectActionComponentUtils)
import Server from "Server" /* 1998 */;
import LocalInteractionComponentStateStore from "LocalInteractionComponentStateStore" /* 8251 */;
2026-10-01 14:13:23 +00:00
import size from "module_2" /* 2 */;
const result = size.fileFinishedImporting("modules/interaction_components/StringSelectActionComponentUtils.tsx");
export const getInitialStringSelectOptions = function getInitialStringSelectOptions(selectionActionComponent, containerId) {
2026-10-01 14:13:23 +00:00
let mapped;
const interactionComponentState = LocalInteractionComponentStateStore.getInteractionComponentState(containerId, selectionActionComponent.id);
let type;
if (interactionComponentState != null) {
type = interactionComponentState.type;
}
if (type === Server.ComponentType.STRING_SELECT) {
2026-10-01 14:13:23 +00:00
mapped = interactionComponentState.values;
} else {
const options = selectionActionComponent.options;
const found = options.filter((item) => item.default);
mapped = found.map((value) => value.value);
}
return mapped;
};