826f6b043c
* move info to its own file
* Revert "move info to its own file"
This reverts commit 1d45a2f403.
* better way
* all cases
* pass labelInfo to ImageEmbed
* blur avatars
* add back as string
* one more as string
* external embed
* add back as string again
22 lines
537 B
TypeScript
22 lines
537 B
TypeScript
import {AppBskyFeedDefs} from '@atproto/api'
|
|
|
|
export const CONTENT_LABELS = ['porn', 'sexual', 'nudity', 'graphic-media']
|
|
|
|
export function labelsToInfo(
|
|
labels?: AppBskyFeedDefs.PostView['labels'],
|
|
): string | undefined {
|
|
const label = labels?.find(label => CONTENT_LABELS.includes(label.val))
|
|
|
|
switch (label?.val) {
|
|
case 'porn':
|
|
case 'sexual':
|
|
return 'Adult Content'
|
|
case 'nudity':
|
|
return 'Non-sexual Nudity'
|
|
case 'graphic-media':
|
|
return 'Graphic Media'
|
|
default:
|
|
return undefined
|
|
}
|
|
}
|