import { Match, Switch } from "solid-js"; import { Trans } from "@lingui-solid/solid/macro"; import { useMutation } from "@tanstack/solid-query"; import { Dialog, DialogProps } from "@revolt/ui"; import { useModals } from ".."; import { Modals } from "../types"; export function ChannelToggleMatureModal( props: DialogProps & Modals & { type: "channel_toggle_mature" }, ) { const { showError } = useModals(); const change = useMutation(() => ({ mutationFn: (nsfw: boolean) => props.channel.edit({ nsfw }), onError: showError, })); return ( Mark this channel as mature?}> Unmark this channel as mature? } actions={[ { text: Keep as is }, { text: ( Mark as mature}> Unmark as mature ), onClick: () => change.mutateAsync(!props.channel.mature), }, ]} isDisabled={change.isPending} > Users will be asked to confirm their age before joining this channel. } > Users will no longer be asked to confirm their age before joining this channel. Please ensure the content is appropriate for all ages. ); }