decord/source/modules/feedback/native/FeedbackForm.tsx

125 lines
4.6 KiB
TypeScript
Raw Normal View History

// Module ID: 11770
// Function ID: 11771
2026-07-20 16:05:17 +00:00
// Name: FeedbackForm
// Dependencies: [32, 19, 11768, 21, 4638, 576, 8402, 12, 11771, 5077, 8728, 4634, 5693, 11772, 1115, 2]
2026-07-20 16:05:17 +00:00
// Exports: FeedbackForm
// Module 11770 (FeedbackForm)
import nativeDefault from "native" /* 576 */;
import FeedbackUtils from "FeedbackUtils" /* 11771 */;
import _slicedToArray from "module_32" /* 32 */;
import noop from "module_19" /* 19 */;
2026-07-23 10:11:24 +00:00
require = fn;
let FeedbackRating = fn(11768).FeedbackRating;
const jsxProd = fn(21);
({ jsx: metroRequire, jsxs: closure_7 } = jsxProd);
const createStyles = fn(4638);
let obj2 = { ratingsLabel: { textAlign: "center" }, reasonsHeader: { marginBottom: 8 }, reasonsList: { overflow: "hidden", marginBottom: 12, padding: 0 }, reason: { color: nativeDefault.colors.INTERACTIVE_TEXT_ACTIVE }, doNotShowAgainContainer: null };
let obj3 = { color: nativeDefault.colors.INTERACTIVE_TEXT_ACTIVE };
obj2.doNotShowAgainContainer = { paddingHorizontal: 0, paddingVertical: 8, backgroundColor: nativeDefault.colors.BACKGROUND_SURFACE_HIGH };
let closure_8 = createStyles.createStyles(obj2);
const size = fn(2);
const result = size.fileFinishedImporting("modules/feedback/native/FeedbackForm.tsx");
2026-07-20 16:05:17 +00:00
export const FeedbackForm = function FeedbackForm(otherKey) {
({ ratingsBodyLabel, reasons } = otherKey);
otherKey = otherKey.otherKey;
const onFeedbackChanged = otherKey.onFeedbackChanged;
2026-07-23 10:11:24 +00:00
const trackOpen = otherKey.trackOpen;
c6 = undefined;
closure_8 = undefined;
2026-07-20 16:05:17 +00:00
({ showDoNotShowAgainCheckbox, reasonsHeaderLabel } = otherKey);
const tmp = closure_8();
noop = tmp;
2026-07-29 08:29:29 +00:00
const tmp4 = otherKey(onFeedbackChanged[6])(reasons);
FeedbackRating = tmp4;
2026-07-23 10:11:24 +00:00
let obj = otherKey(onFeedbackChanged[7]);
let tmp2 = otherKey;
[arr, c6] = trackOpen(noop.useState(otherKey(onFeedbackChanged[7]).shuffle(reasons)), 2);
2026-07-29 08:29:29 +00:00
let items = [reasons, tmp4, otherKey];
const effect = noop.useEffect(() => {
2026-08-24 06:08:38 +00:00
if (!obj.isEqual(closure_5, reasons)) {
_undefined(FeedbackUtils.shuffleProblems(reasons, otherKey));
2026-07-20 16:05:17 +00:00
}
}, items);
const tmp8 = trackOpen(noop.useState({}), 2);
const first = tmp8[0];
closure_8 = tmp8[1];
2026-07-23 10:11:24 +00:00
otherKey(onFeedbackChanged[9])(() => {
2026-07-20 16:05:17 +00:00
trackOpen();
});
2026-07-29 08:29:29 +00:00
const items1 = [first, onFeedbackChanged];
const callback = noop.useCallback(() => {
2026-07-29 08:29:29 +00:00
let flag = first.doNotShowAgain;
if (flag == null) {
flag = false;
}
2026-07-20 16:05:17 +00:00
const obj = {};
2026-07-29 08:29:29 +00:00
const merged = Object.assign(tmp);
obj.doNotShowAgain = !flag;
closure_8(obj);
2026-07-29 08:29:29 +00:00
onFeedbackChanged(first);
2026-07-20 16:05:17 +00:00
}, items1);
2026-07-29 08:29:29 +00:00
const found = arr.filter((label) => Boolean(label.label));
let tmp14 = null;
if (null != first.rating) {
tmp14 = null;
if (first.rating !== FeedbackRating.GOOD) {
let obj2 = { children: null };
const obj3 = { style: tmp.reasonsHeader, variant: "eyebrow", color: "text-default", children: reasonsHeaderLabel };
const items2 = [c6(reasons(tmp3[11]).Text, obj3), ];
const obj4 = { border: "subtle", style: tmp.reasonsList, children: tmp13 };
items2[1] = c6(reasons(tmp3[12]).Card, obj4);
obj2.children = items2;
tmp14 = first(tmp5.Fragment, obj2);
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
let tmp17 = null;
2026-07-20 16:05:17 +00:00
if (null != ratingsBodyLabel) {
const obj5 = { style: tmp.ratingsLabel, variant: "heading-md/semibold", color: "text-default", children: ratingsBodyLabel };
tmp17 = c6(reasons(tmp3[11]).Text, obj5);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
const children = [tmp17, , , ];
let rating = first.rating;
const tmp16 = first;
const tmp6 = trackOpen(noop.useState(otherKey(onFeedbackChanged[7]).shuffle(reasons)), 2);
2026-07-29 08:29:29 +00:00
if (rating == null) {
rating = null;
2026-07-20 16:05:17 +00:00
}
children[1] = c6(tmp2(onFeedbackChanged[13]), {
2026-07-29 08:29:29 +00:00
selectedRating: rating,
onChangeRating(rating) {
let reason = null;
if (rating !== FeedbackRating.GOOD) {
2026-07-29 08:29:29 +00:00
reason = first.reason;
}
const obj = {};
const merged = Object.assign(first);
obj.rating = rating;
obj.reason = reason;
closure_8(obj);
2026-07-29 08:29:29 +00:00
onFeedbackChanged(obj);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
});
children[2] = tmp14;
let tmp20Result = null;
2026-07-20 16:05:17 +00:00
if (showDoNotShowAgainCheckbox) {
const obj7 = { style: tmp.doNotShowAgainContainer, leading: null, label: null, onPress: null };
2026-07-29 08:29:29 +00:00
let flag = first.doNotShowAgain;
if (flag == null) {
flag = false;
2026-07-20 16:05:17 +00:00
}
const obj8 = { selected: flag };
obj7.leading = tmp20(reasons(tmp3[10]).FormRow.Checkbox, obj8);
const obj9 = { text: null };
2026-07-29 08:29:29 +00:00
const intl = tmp24(tmp3[14]).intl;
obj9.text = intl.string(reasons(tmp3[14]).t["5E9SB9"]);
obj7.label = tmp20(reasons(tmp3[10]).FormRow.Label, obj9);
obj7.onPress = callback;
tmp20Result = tmp20(reasons(tmp3[10]).FormRow, obj7);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
children[3] = tmp20Result;
return tmp16(noop.Fragment, { children });
2026-07-20 16:05:17 +00:00
};