({
item,
isCopied = false
}: {
item: (typeof aiIconList)[number];
isCopied?: boolean;
})
| 143 | }); |
| 144 | |
| 145 | function AIIconItem({ |
| 146 | item, |
| 147 | isCopied = false |
| 148 | }: { |
| 149 | item: (typeof aiIconList)[number]; |
| 150 | isCopied?: boolean; |
| 151 | }) { |
| 152 | let ref = useRef(null); |
| 153 | // oxlint-disable react/react-compiler |
| 154 | return ( |
| 155 | <ListBoxItem |
| 156 | id={item.id} |
| 157 | value={item} |
| 158 | textValue={item.id} |
| 159 | className={itemStyle} |
| 160 | ref={ref} |
| 161 | style={pressScale(ref)}> |
| 162 | {({isHovered, isFocusVisible}) => |
| 163 | isCopied ? ( |
| 164 | <> |
| 165 | <CheckmarkCircle styles={iconStyle({size: 'XL'})} /> |
| 166 | <div |
| 167 | className={style({ |
| 168 | maxWidth: '100%', |
| 169 | textOverflow: 'ellipsis', |
| 170 | overflow: 'hidden', |
| 171 | whiteSpace: 'nowrap' |
| 172 | })}> |
| 173 | Copied! |
| 174 | </div> |
| 175 | </> |
| 176 | ) : ( |
| 177 | <> |
| 178 | {/* Only animate the tile under the pointer or keyboard focus, so the grid isn't |
| 179 | looping dozens of pixel animations simultaneously. */} |
| 180 | <PixelLoader icon={item.cells} isPlaying={isHovered || isFocusVisible} /> |
| 181 | <div |
| 182 | className={style({ |
| 183 | maxWidth: '100%', |
| 184 | textOverflow: 'ellipsis', |
| 185 | overflow: 'hidden', |
| 186 | whiteSpace: 'nowrap' |
| 187 | })}> |
| 188 | {item.id} |
| 189 | </div> |
| 190 | </> |
| 191 | ) |
| 192 | } |
| 193 | </ListBoxItem> |
| 194 | ); |
| 195 | // oxlint-enable react/react-compiler |
| 196 | } |
| 197 | |
| 198 | interface AIIconListBoxProps { |
| 199 | items: typeof aiIconList; |
nothing calls this directly
no test coverage detected