Something went wrong. Try again.
Mirror — see github.com/blacksky-algorithms/blacksky.community
Something went wrong. Try again.
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364import {type MessageDescriptor} from '@lingui/core'import {msg} from '@lingui/core/macro'
import {type tools} from '#/lexicons'
type ReportResolutionOutcome = NonNullable< tools.ozone.inbox.getReport.$OutputBody['resolution']>['outcome']
export function getReportActionLabel({ status, lastActionTaken, resolutionOutcome,}: { status: string lastActionTaken?: string resolutionOutcome?: ReportResolutionOutcome}): MessageDescriptor | undefined { if (resolutionOutcome === 'noAction') { return msg`Reviewed, no action taken` }
if (lastActionTaken) { switch (lastActionTaken) { case 'contentRemoved': return msg`Content removed` case 'contentRestored': return msg`Content restored` case 'accountSuspended': return msg`Account suspended` case 'accountTakedown': return msg`Account taken down` case 'accountRestored': return msg`Account restored` case 'labelApplied': return msg`Label applied` case 'labelRemoved': return msg`Label removed` case 'communicationSent': return msg`Communication sent` case 'reportingRestricted': return msg`Reporting restricted` case 'credentialsRevoked': return msg`Credentials revoked` default: return msg`Action taken` } }
if (resolutionOutcome === 'actionTaken') { return msg`Action taken` }
if (status === 'pending') { return msg`Awaiting review` }
if (status === 'resolved') { return msg`Report resolved` }
return undefined}