({ items }: { items: RowItem[] })
| 228 | }; |
| 229 | |
| 230 | export const Segments = ({ items }: { items: RowItem[] }): ReactElement => ( |
| 231 | <> |
| 232 | {items.map((item) => { |
| 233 | const className = classNames( |
| 234 | tabClassName, |
| 235 | item.active ? 'text-text-primary' : 'text-text-tertiary', |
| 236 | ); |
| 237 | // The lit tab's chevron hangs in its side padding, so it appears |
| 238 | // without moving the label. |
| 239 | const content = ( |
| 240 | <TabLabel label={item.label} isLit={item.active}> |
| 241 | {item.active && item.menu && ( |
| 242 | <ArrowIcon |
| 243 | size={IconSize.XXSmall} |
| 244 | className="absolute left-full ml-1 rotate-180 text-text-secondary" |
| 245 | /> |
| 246 | )} |
| 247 | </TabLabel> |
| 248 | ); |
| 249 | |
| 250 | // The lit tab that carries a menu is already the page, so it is the |
| 251 | // menu's button rather than a link with a button inside. |
| 252 | if (item.active && item.menu) { |
| 253 | return ( |
| 254 | <RowChip |
| 255 | key={item.key} |
| 256 | item={{ |
| 257 | ...item, |
| 258 | href: undefined, |
| 259 | ariaLabel: item.menu.ariaLabel, |
| 260 | onClick: item.menu.onOpen, |
| 261 | }} |
| 262 | className={className} |
| 263 | content={content} |
| 264 | /> |
| 265 | ); |
| 266 | } |
| 267 | |
| 268 | return ( |
| 269 | <RowChip |
| 270 | key={item.key} |
| 271 | item={item} |
| 272 | className={className} |
| 273 | content={content} |
| 274 | /> |
| 275 | ); |
| 276 | })} |
| 277 | </> |
| 278 | ); |
| 279 | |
| 280 | export const Chips = ({ items }: { items: RowItem[] }): ReactElement => ( |
| 281 | <> |
nothing calls this directly
no outgoing calls
no test coverage detected