import React from 'react' import {View} from 'react-native' import {msg, Trans} from '@lingui/macro' import {useLingui} from '@lingui/react' import {ComAtprotoLabelDefs} from '@atproto/api' import {atoms as a, useBreakpoints, useTheme} from '#/alf' import {Text} from '#/components/Typography' import * as Dialog from '#/components/Dialog' import {Button} from '#/components/Button' import {capitalize} from '#/lib/strings/capitalize' export {useDialogControl as useLabelsOnMeDialogControl} from '#/components/Dialog' type Subject = | { uri: string cid: string } | { did: string } export interface LabelsOnMeDialogProps { control: Dialog.DialogOuterProps['control'] subject: Subject labels: ComAtprotoLabelDefs.Label[] } export function LabelsOnMeDialogInner(props: LabelsOnMeDialogProps) { const t = useTheme() const {_} = useLingui() const {gtMobile} = useBreakpoints() const {subject, labels} = props const isAccount = 'did' in subject // TODO // const submit = async () => { // try { // const $type = !isAccountReport // ? 'com.atproto.repo.strongRef' // : 'com.atproto.admin.defs#repoRef' // await getAgent().createModerationReport({ // reasonType: ComAtprotoModerationDefs.REASONAPPEAL, // subject: { // $type, // ...props, // }, // reason: details, // }) // Toast.show(_(msg`We'll look into your appeal promptly.`)) // } finally { // closeModal() // } // } return ( The following labels were applied to your{' '} {isAccount ? 'account' : 'content'} You may appeal these labels if you feel they were placed in error. {labels.map(label => ( {capitalize(label.val)} ))} ) } export function LabelsOnMeDialog(props: LabelsOnMeDialogProps) { return ( ) }