Files
blitzkit/src/components/TankRowHeaderCell.tsx
T

52 lines
1.4 KiB
TypeScript
Raw Normal View History

2024-06-30 19:34:55 -05:00
import { Table } from '@radix-ui/themes';
2024-06-29 21:22:12 -05:00
import { TankDefinition } from '../core/blitzkit/tankDefinitions';
import { tankIcon } from '../core/blitzkit/tankIcon';
2024-06-30 18:26:05 -05:00
import { ExperimentIcon } from './ExperimentIcon';
2024-06-29 21:22:12 -05:00
import { Link } from './Link';
interface TankRowHeaderCellProps {
tank: TankDefinition;
}
export function TankRowHeaderCell({ tank }: TankRowHeaderCellProps) {
return (
2024-06-30 18:26:05 -05:00
<Table.RowHeaderCell style={{ display: 'flex' }}>
2024-06-29 21:22:12 -05:00
<Link href={`/tools/tankopedia/${tank.id}`}>
<img
alt={tank.name}
draggable={false}
src={tankIcon(tank.id)}
style={{
2024-06-30 18:26:05 -05:00
margin: 'calc(-1 * var(--table-cell-padding)) 0',
height: 'calc(100% + 2 * var(--table-cell-padding))',
aspectRatio: '16 / 9',
objectFit: 'cover',
2024-06-29 21:22:12 -05:00
}}
/>
2024-06-30 18:26:05 -05:00
</Link>
2024-06-29 21:22:12 -05:00
2024-06-30 18:26:05 -05:00
<Link
color="gray"
highContrast
underline="hover"
wrap="nowrap"
href={`/tools/tankopedia/${tank.id}`}
style={{
paddingLeft: 'var(--space-2)',
2024-06-30 19:34:55 -05:00
display: 'flex',
alignItems: 'center',
gap: 'var(--space-1)',
width: 128,
overflow: 'hidden',
textOverflow: 'ellipsis',
whiteSpace: 'nowrap',
2024-06-30 18:26:05 -05:00
}}
>
2024-06-30 19:34:55 -05:00
{tank.testing && (
<ExperimentIcon style={{ width: '1em', height: '1em' }} />
)}
{tank.name}
2024-06-29 21:22:12 -05:00
</Link>
</Table.RowHeaderCell>
);
}