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

Function getPickSignal

packages/shared/src/components/picks/PickRow.tsx:21–46  ·  view source on GitHub ↗
({
  upvoted,
  bookmarked,
  read,
  post,
  reason,
}: Omit<PickRowData, 'reason'> & { reason?: PickRowReason })

Source from the content-addressed store, hash-verified

19};
20
21export const getPickSignal = ({
22 upvoted,
23 bookmarked,
24 read,
25 post,
26 reason,
27}: Omit<PickRowData, 'reason'> & { reason?: PickRowReason }): string => {
28 const parts: string[] = [];
29 if (upvoted) {
30 parts.push('▲ upvoted');
31 }
32 if (bookmarked) {
33 parts.push('bookmarked');
34 }
35 if (read && !upvoted && !bookmarked) {
36 parts.push('read');
37 }
38 const fillLabel = reason && fillLabels[reason];
39 if (fillLabel && !parts.length) {
40 parts.push(fillLabel);
41 }
42 if (post.readTime) {
43 parts.push(`${post.readTime} min`);
44 }
45 return parts.join(' · ');
46};
47
48interface PickRowProps {
49 row: PickRowData;

Callers 1

PickRowFunction · 0.85

Calls 1

pushMethod · 0.80

Tested by

no test coverage detected