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

Function PatchyBoneCard

packages/shared/src/features/patchy/PatchyPanel.tsx:39–78  ·  view source on GitHub ↗
({
  hasFreeBone,
  bonesGiven,
  giveFreeBone,
}: ReturnType<typeof usePatchyBone>)

Source from the content-addressed store, hash-verified

37}
38
39const PatchyBoneCard = ({
40 hasFreeBone,
41 bonesGiven,
42 giveFreeBone,
43}: ReturnType<typeof usePatchyBone>): ReactElement => {
44 const bonesLine =
45 bonesGiven === 1
46 ? '1 bone given so far'
47 : `${bonesGiven} bones given so far`;
48 return (
49 <div className="flex flex-col gap-3 rounded-16 bg-surface-float p-3">
50 <div className="flex items-center gap-3">
51 <span className="flex size-12 shrink-0 items-center justify-center rounded-12 bg-background-default">
52 <PatchyBoneImage className="size-9" />
53 </span>
54 <div className="flex min-w-0 flex-1 flex-col gap-0.5">
55 <Typography type={TypographyType.Callout} bold>
56 Treat Patchy
57 </Typography>
58 <Typography
59 type={TypographyType.Footnote}
60 color={TypographyColor.Tertiary}
61 >
62 {hasFreeBone || !bonesGiven ? 'One free bone a day' : bonesLine}
63 </Typography>
64 </div>
65 </div>
66 <Button
67 type="button"
68 size={ButtonSize.Small}
69 variant={hasFreeBone ? ButtonVariant.Primary : ButtonVariant.Float}
70 disabled={!hasFreeBone}
71 onClick={giveFreeBone}
72 className="w-full"
73 >
74 {hasFreeBone ? 'Give a bone' : 'Next free bone tomorrow'}
75 </Button>
76 </div>
77 );
78};
79
80// Patchy's own panel, opened from his spot on the rail: him up close (the
81// same circle, animations and reactions as on the rail), a line about where

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected