2024-06-30 18:26:05 -05:00
|
|
|
import { Flex, 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)',
|
|
|
|
|
}}
|
|
|
|
|
>
|
|
|
|
|
<Flex align="center" gap="1" position="relative" pl="2">
|
|
|
|
|
{tank.testing && (
|
|
|
|
|
<ExperimentIcon style={{ width: '1em', height: '1em' }} />
|
|
|
|
|
)}
|
2024-06-29 21:22:12 -05:00
|
|
|
{tank.name}
|
2024-06-30 18:26:05 -05:00
|
|
|
</Flex>
|
2024-06-29 21:22:12 -05:00
|
|
|
</Link>
|
|
|
|
|
</Table.RowHeaderCell>
|
|
|
|
|
);
|
|
|
|
|
}
|