(item: (typeof items)[0], action: Key)
| 208 | let [dialog, setDialog] = useState<Key | null>(null); |
| 209 | let [actionItem, setActionItem] = useState<Plant | null>(null); |
| 210 | let onAction = (item: (typeof items)[0], action: Key) => { |
| 211 | switch (action) { |
| 212 | case 'favorite': |
| 213 | toggleFavorite(item.id, !item.isFavorite); |
| 214 | break; |
| 215 | default: |
| 216 | setDialog(action); |
| 217 | setActionItem(item); |
| 218 | break; |
| 219 | } |
| 220 | }; |
| 221 | |
| 222 | let onDialogClose = () => setDialog(null); |
| 223 |
no test coverage detected