Files
discord-decomp/modules/custom_status/native/ClearAfterOptionsActionSheet.tsx
T
2026-11-01 12:12:55 +02:00

40 lines
2.0 KiB
TypeScript

// Metro module 11981 (f11982).
import { useState } from "react";
import { View } from "react-native";
import { ClearAfterOptions } from "../Constants";
import { createStyles } from "../../../design/components/Styles/native/createStyles";
import Module712 from "../../../_bundle/Module712";
import { BottomSheet } from "../../../design/components/Sheet/native/BottomSheet.native";
import { BottomSheetTitleHeader } from "../../../design/components/Sheet/native/BottomSheetTitleHeader.native";
import { intl, t } from "../../../intl/index.native";
import { TableRadioGroup } from "../../../design/components/TableRow/native/TableRadioGroup.native";
import { TableRadioRow } from "../../../design/components/TableRow/native/TableRadioRow.native";
import formatClearAfterOption from "../utils/formatClearAfterOption";
import { Button } from "../../../design/components/Button/native/Button.native";
import ActionSheetActionCreators from "../../action_sheet/native/ActionSheetActionCreators";
const useStyles = createStyles({
content: {
paddingHorizontal: Module712.space.PX_16
},
buttonWrapper: {
marginTop: Module712.space.PX_24,
paddingBottom: Module712.space.PX_16
}
});
export default function ClearAfterOptionsActionSheet(props) {
const { initialValue, onChange } = props;
const styles = useStyles();
const [state, onChange2] = useState(initialValue);
return <BottomSheet contentStyles={styles.content} header={<BottomSheetTitleHeader title={intl.string(t["5XnRQ+"])} />}>
<TableRadioGroup onChange={onChange2} title={intl.string(t.E45wvP)} defaultValue={initialValue} hasIcons={false}>
{ClearAfterOptions.map((clearAfterOption) => <TableRadioRow key={clearAfterOption} value={clearAfterOption} label={formatClearAfterOption(clearAfterOption)} />)}
</TableRadioGroup>
<View style={styles.buttonWrapper}>
<Button onPress={function onPress() {
onChange(state);
ActionSheetActionCreators.hideActionSheet();
}} text={intl.string(t.TyCVIq)} />
</View>
</BottomSheet>;
};