({
workspace,
children,
checked,
})
| 311 | } |
| 312 | |
| 313 | const WorkspacesRow: FC<WorkspacesRowProps> = ({ |
| 314 | workspace, |
| 315 | children, |
| 316 | checked, |
| 317 | }) => { |
| 318 | const navigate = useNavigate(); |
| 319 | |
| 320 | const workspacePageLink = `/@${workspace.owner_name}/${workspace.name}`; |
| 321 | const openLinkInNewTab = () => window.open(workspacePageLink, "_blank"); |
| 322 | const { role, hover, ...clickableProps } = useClickableTableRow({ |
| 323 | onMiddleClick: openLinkInNewTab, |
| 324 | onClick: (event) => { |
| 325 | // Order of booleans actually matters here for Windows-Mac compatibility; |
| 326 | // meta key is Cmd on Macs, but on Windows, it's either the Windows key, |
| 327 | // or the key does nothing at all (depends on the browser) |
| 328 | const shouldOpenInNewTab = |
| 329 | event.shiftKey || event.metaKey || event.ctrlKey; |
| 330 | |
| 331 | if (shouldOpenInNewTab) { |
| 332 | openLinkInNewTab(); |
| 333 | } else { |
| 334 | navigate(workspacePageLink); |
| 335 | } |
| 336 | }, |
| 337 | }); |
| 338 | |
| 339 | return ( |
| 340 | <TableRow |
| 341 | {...clickableProps} |
| 342 | data-testid={`workspace-${workspace.id}`} |
| 343 | className={cn([ |
| 344 | checked ? "bg-surface-secondary hover:bg-surface-secondary" : undefined, |
| 345 | clickableProps.className, |
| 346 | ])} |
| 347 | > |
| 348 | {children} |
| 349 | </TableRow> |
| 350 | ); |
| 351 | }; |
| 352 | |
| 353 | const TableLoader: FC = () => { |
| 354 | return ( |
nothing calls this directly
no test coverage detected