({
patchy,
state,
hasReadToday,
onClose,
}: PatchyPanelProps)
| 81 | // same circle, animations and reactions as on the rail), a line about where |
| 82 | // you are, what he can do for you here, and his bone. |
| 83 | export const PatchyPanel = ({ |
| 84 | patchy, |
| 85 | state, |
| 86 | hasReadToday, |
| 87 | onClose, |
| 88 | }: PatchyPanelProps): ReactElement => { |
| 89 | const { moods } = getPatchyConfig(); |
| 90 | const context = usePatchyContext(); |
| 91 | const contextLine = getPatchyContextLine(context); |
| 92 | const bone = usePatchyBone(); |
| 93 | // Today's bone is still waiting: he looks up hopefully, unless he's busy |
| 94 | // reacting, reading or suggesting something. |
| 95 | const isHopeful = |
| 96 | bone.hasFreeBone && !patchy.emote && patchy.face !== 'reading'; |
| 97 | |
| 98 | return ( |
| 99 | <div className="flex flex-col gap-3 px-4 pb-4 pt-1"> |
| 100 | <div className="flex flex-col items-center gap-3 rounded-16 bg-surface-float px-3 pb-3 pt-6"> |
| 101 | <span className="flex size-20 items-center justify-center"> |
| 102 | <span className="scale-[2.5]"> |
| 103 | <PatchyRailIcon |
| 104 | face={isHopeful ? 'hopeful' : patchy.face} |
| 105 | motion={isHopeful ? null : patchy.motion} |
| 106 | motionKey={patchy.motionKey} |
| 107 | emote={patchy.emote} |
| 108 | emoteCount={patchy.emoteCount} |
| 109 | emoteKey={patchy.emoteKey} |
| 110 | state={state} |
| 111 | hasReadToday={hasReadToday} |
| 112 | showStreak={false} |
| 113 | /> |
| 114 | </span> |
| 115 | </span> |
| 116 | <div className="flex flex-col items-center text-center"> |
| 117 | <Typography type={TypographyType.Body} bold> |
| 118 | Patchy is {moods[patchy.mood].label} |
| 119 | </Typography> |
| 120 | <Typography |
| 121 | type={TypographyType.Callout} |
| 122 | color={TypographyColor.Secondary} |
| 123 | > |
| 124 | {contextLine ?? moods[patchy.mood].copy} |
| 125 | </Typography> |
| 126 | </div> |
| 127 | </div> |
| 128 | <PatchyBoneCard {...bone} /> |
| 129 | <PatchyMenu context={context} onNavigate={onClose} /> |
| 130 | </div> |
| 131 | ); |
| 132 | }; |
nothing calls this directly
no test coverage detected