Files
discord-decomp/modules/voice_panel/native/alerts/VoicePanelNsfwAlert.tsx
T
2026-11-01 12:12:55 +02:00

26 lines
1.6 KiB
TypeScript

// Metro module 16012 (f16013).
import { isGuildNSFW } from "../../../../records/GuildRecord";
import GuildStore from "../../../../stores/GuildStore";
import { useDismissModalCallback, AlertActions } from "../../../../design/components/AlertModal/native/AlertModal.native";
import { AlertModal, AlertActionButton } from "../../../../design/components/AlertModal/native/AlertModal.native";
import { intl, t } from "../../../../intl/index.native";
import GuildActionCreators from "../../../../actions/GuildActionCreators";
import SelectedChannelActionCreators from "../../../../actions/SelectedChannelActionCreators";
export default function VoicePanelNsfwAlert(props) {
const { guildId, channelId } = props;
const dismissModalCallback = useDismissModalCallback();
const isGuildNSFW2 = isGuildNSFW(GuildStore.getGuild(guildId));
return <AlertModal title={isGuildNSFW2 ? intl.string(t.xi46lg) : intl.string(t.ZmwvDc)} content={isGuildNSFW2 ? intl.string(t.ZtuRts) : intl.string(t.E4Cd5I)} actions={<AlertActions>
<AlertActionButton key="confirm" variant="primary" onPress={function onPress() {
GuildActionCreators.nsfwAgree(guildId);
SelectedChannelActionCreators.selectVoiceChannel(channelId);
dismissModalCallback();
}} text={intl.string(t.wVq7uo)} />
<AlertActionButton key="add-profile-picture" variant="secondary" onPress={function onPress() {
GuildActionCreators.nsfwReturnToSafety(guildId);
dismissModalCallback();
}} text={intl.string(t["/g10LC"])} />
</AlertActions>} />;
};
export const VOICE_PANEL_NSFW_KEY = "voice-panel-nsfw";