mirror of https://git.lenooby09.tech/LeNooby09/social-app.git
at rm-proxy 21 lines 537 B view raw
1import {AppBskyFeedDefs} from '@atproto/api' 2 3export const CONTENT_LABELS = ['porn', 'sexual', 'nudity', 'graphic-media'] 4 5export function labelsToInfo( 6 labels?: AppBskyFeedDefs.PostView['labels'], 7): string | undefined { 8 const label = labels?.find(label => CONTENT_LABELS.includes(label.val)) 9 10 switch (label?.val) { 11 case 'porn': 12 case 'sexual': 13 return 'Adult Content' 14 case 'nudity': 15 return 'Non-sexual Nudity' 16 case 'graphic-media': 17 return 'Graphic Media' 18 default: 19 return undefined 20 } 21}