-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* move info to its own file * Revert "move info to its own file" This reverts commit 1d45a2f. * 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
- Loading branch information
Showing
3 changed files
with
91 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
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 | ||
} | ||
} |