()
| 143 | }, [favoriteKey]); |
| 144 | |
| 145 | const toggleFavorite = () => { |
| 146 | if (!favoriteKey) return; |
| 147 | const { saved } = toggleSavedComponent(favoriteKey); |
| 148 | setIsSaved(saved); |
| 149 | |
| 150 | const nameEl = ( |
| 151 | <span> |
| 152 | {' '} |
| 153 | <span style={{ color: colors.accent, fontWeight: 700 }}><{componentName} /></span> |
| 154 | </span> |
| 155 | ); |
| 156 | |
| 157 | if (saved) toast.success?.(<>Added {nameEl} to favorites</>) ?? toast(<>Added {nameEl} to favorites</>); |
| 158 | else toast.error?.(<>Removed {nameEl} from favorites</>) ?? toast(<>Removed {nameEl} from favorites</>); |
| 159 | }; |
| 160 | const contentMap = { |
| 161 | PreviewTab: null, |
| 162 | CodeTab: null |
nothing calls this directly
no test coverage detected