decord/source/modules/parent_tools/native/FamilyCenterParentalControlsScreenTime.tsx

99 lines
3.6 KiB
TypeScript
Raw Normal View History

// Module ID: 14987
// Function ID: 14988
// Name: FamilyCenterParentalControlsScreenTime
// Dependencies: [17, 1074, 21, 4607, 576, 10175, 5657, 4603, 1114, 2396, 14948, 1483, 5739, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
// Module 14987 (FamilyCenterParentalControlsScreenTime)
import _mod17 from "module_17" /* 17 */;
import nativeDefault from "native" /* 576 */;
import Constants from "Constants" /* 1074 */;
import _modDef2396 from "module_2396" /* 2396 */;
2026-08-24 06:08:38 +00:00
import jsxProd from "jsxProd" /* 21 */;
import createStyles from "createStyles" /* 4607 */;
import size from "module_2" /* 2 */;
const require = globalThis.__r;
2026-07-23 10:11:24 +00:00
2026-07-20 16:05:17 +00:00
function ScheduleRuleRow(rule) {
rule = rule.rule;
2026-07-23 10:11:24 +00:00
({ teenId: importDefault, navigation: dependencyMap, readOnly } = rule);
2026-07-20 16:05:17 +00:00
if (readOnly === undefined) {
readOnly = false;
}
const scheduleRuleDateRange = rule(10175).getScheduleRuleDateRange(rule);
let obj = rule(10175);
const obj2 = rule(10175);
const obj3 = { label: scheduleRuleDateRange, subLabel: rule(10175).formatDays(rule.days), trailing: null, arrow: null, onPress: null };
const intl = rule(1114).intl;
2026-07-20 16:05:17 +00:00
const string = intl.string;
const tmp4 = _modDef2396;
2026-07-20 16:05:17 +00:00
if (rule.enabled) {
2026-07-29 08:29:29 +00:00
let stringResult = string(tmp4["8vDHRq"]);
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
stringResult = string(tmp4["4z9fN+"]);
2026-07-20 16:05:17 +00:00
}
obj3.trailing = closure_5(rule(4603).Text, { variant: "text-sm/medium", color: "text-subtle", children: stringResult });
obj3.arrow = !readOnly;
2026-07-20 16:05:17 +00:00
let fn;
if (!readOnly) {
fn = () => {
const obj = { teenId, rule: null };
2026-07-20 16:05:17 +00:00
const merged = Object.assign(rule);
obj.rule = {};
return navigation.navigate(UserSettingsSections.FAMILY_CENTER_SCHEDULE_DOWNTIME, obj);
2026-07-20 16:05:17 +00:00
};
}
obj3.onPress = fn;
return closure_5(rule(5657).TableRow, obj3);
2026-07-20 16:05:17 +00:00
}
const View = _mod17.View;
const UserSettingsSections = Constants.UserSettingsSections;
({ jsx: hasOwnProperty, jsxs: metroRequire } = jsxProd);
let obj = { header: { paddingTop: nativeDefault.space.PX_24 }, container: null };
let obj2 = { paddingTop: nativeDefault.space.PX_24 };
obj.container = { paddingHorizontal: nativeDefault.space.PX_16, gap: nativeDefault.space.PX_8 };
let closure_7 = createStyles.createStyles(obj);
const result = size.fileFinishedImporting("modules/parent_tools/native/FamilyCenterParentalControlsScreenTime.tsx");
2026-07-20 16:05:17 +00:00
export default function FamilyCenterParentalControlsScreenTime(readOnly) {
let flag = readOnly.readOnly;
if (flag === undefined) {
flag = false;
}
2026-07-23 10:11:24 +00:00
let id;
const tmp = closure_7();
const selectedTeenUser = flag(id[10]).useSelectedTeenUser();
const obj = flag(id[10]);
importDefault = flag(id[11]).useNavigation();
2026-07-23 10:11:24 +00:00
id = undefined;
2026-07-29 08:29:29 +00:00
if (selectedTeenUser != null) {
2026-07-20 16:05:17 +00:00
id = selectedTeenUser.id;
}
let rules;
2026-07-29 08:29:29 +00:00
if (selectedTeenUser != null) {
2026-07-20 16:05:17 +00:00
const restrictedSchedule = selectedTeenUser.restrictedSchedule;
2026-07-29 08:29:29 +00:00
if (restrictedSchedule != null) {
2026-07-20 16:05:17 +00:00
rules = restrictedSchedule.rules;
}
}
2026-07-29 08:29:29 +00:00
if (rules == null) {
2026-07-20 16:05:17 +00:00
rules = [];
}
const obj2 = flag(id[11]);
2026-07-29 08:29:29 +00:00
const tmp2Result = flag(id[5]);
let tmp6 = null;
2026-07-20 16:05:17 +00:00
if (null != id) {
const obj3 = { style: tmp.container, children: null };
const obj4 = { variant: "text-sm/semibold", color: "text-subtle", style: tmp.header, children: null };
2026-07-29 08:29:29 +00:00
const intl = tmp2(tmp3[8]).intl;
obj4.children = intl.string(require("module_2396")["72CmJd"]);
const items = [closure_5(tmp2(tmp3[7]).Text, obj4), ];
const obj5 = { hasIcons: false, children: sortRulesByStartTimeResult.map((rule) => hasOwnProperty(ScheduleRuleRow, { rule, teenId: id, navigation, readOnly: flag }, rule.ruleId)) };
items[1] = closure_5(tmp2(tmp3[12]).TableRowGroup, obj5);
obj3.children = items;
tmp6 = closure_6(View, obj3);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return tmp6;
2026-07-20 16:05:17 +00:00
};