(item: MenuItem)
| 291 | }); |
| 292 | |
| 293 | const togglePicks = (item: MenuItem) => { |
| 294 | if (!item.picks) { |
| 295 | return; |
| 296 | } |
| 297 | if (picks?.kind === item.picks) { |
| 298 | setPicks(null); |
| 299 | return; |
| 300 | } |
| 301 | log(item); |
| 302 | const excludeId = context.kind === 'post' ? context.post.id : undefined; |
| 303 | setPicks({ |
| 304 | kind: item.picks, |
| 305 | posts: getPatchyQuickReads(client, { |
| 306 | limit: 3, |
| 307 | excludeId, |
| 308 | tag: |
| 309 | item.picks === 'tag' && context.kind === 'tag' |
| 310 | ? context.tag |
| 311 | : undefined, |
| 312 | isBookmarked: item.picks === 'bookmarks', |
| 313 | }), |
| 314 | }); |
| 315 | }; |
| 316 | |
| 317 | return ( |
| 318 | <nav aria-label="Ask Patchy" className="flex flex-col"> |
no test coverage detected