MCPcopy Create free account
hub / github.com/dailydotdev/apps / getBlockLabel

Function getBlockLabel

packages/shared/src/features/posts/PostOptionButton.tsx:116–134  ·  view source on GitHub ↗
(
  name: string,
  { isCustomFeed, isBlocked }: Record<'isCustomFeed' | 'isBlocked', boolean>,
)

Source from the content-addressed store, hash-verified

114import { useFeedContentTypeAction } from '../../components/filters/useFeedContentTypeAction';
115
116const getBlockLabel = (
117 name: string,
118 { isCustomFeed, isBlocked }: Record<'isCustomFeed' | 'isBlocked', boolean>,
119) => {
120 const blockLabel = {
121 global: {
122 block: `Block ${name}`,
123 unblock: `Unblock ${name}`,
124 },
125 feed: {
126 block: `Remove ${name} from this feed`,
127 unblock: `Add ${name} to this feed`,
128 },
129 };
130
131 return blockLabel[isCustomFeed ? 'feed' : 'global'][
132 isBlocked ? 'unblock' : 'block'
133 ];
134};
135
136const PostOptionButtonContent = ({
137 post: initialPost,

Callers 1

PostOptionButtonContentFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected