2025-10-14 12:11:31 -05:00
|
|
|
import { Table, Text } from "@radix-ui/themes";
|
|
|
|
|
import { useLocale } from "../hooks/useLocale";
|
|
|
|
|
import { Playlist } from "../stores/playlist";
|
|
|
|
|
import { PlaylistTankEntry } from "./PlaylistTankEntry";
|
|
|
|
|
import { StickyColumnHeaderCell } from "./StickyColumnHeaderCell";
|
|
|
|
|
import { StickyTableRoot } from "./StickyTableRoot";
|
|
|
|
|
|
|
|
|
|
export function PlaylistTable() {
|
|
|
|
|
const { strings } = useLocale();
|
|
|
|
|
const list = Playlist.use((state) => state.list);
|
|
|
|
|
|
|
|
|
|
if (!list) return null;
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<StickyTableRoot
|
|
|
|
|
style={{
|
|
|
|
|
position: "absolute",
|
|
|
|
|
top: 0,
|
|
|
|
|
left: 0,
|
|
|
|
|
height: "100%",
|
|
|
|
|
width: "100%",
|
|
|
|
|
borderRadius: 0,
|
|
|
|
|
}}
|
|
|
|
|
variant="surface"
|
|
|
|
|
>
|
|
|
|
|
<Table.Header>
|
|
|
|
|
<Table.Row>
|
|
|
|
|
<StickyColumnHeaderCell width="0">
|
|
|
|
|
<Text color="gray">
|
|
|
|
|
{strings.website.tools.playlist.table.index}
|
|
|
|
|
</Text>
|
|
|
|
|
</StickyColumnHeaderCell>
|
|
|
|
|
|
2025-10-14 21:36:37 -05:00
|
|
|
<StickyColumnHeaderCell width="0" />
|
|
|
|
|
|
|
|
|
|
<StickyColumnHeaderCell width="0" />
|
|
|
|
|
|
2025-10-14 12:11:31 -05:00
|
|
|
<StickyColumnHeaderCell width="1">
|
|
|
|
|
{strings.website.tools.playlist.table.tank}
|
|
|
|
|
</StickyColumnHeaderCell>
|
|
|
|
|
|
|
|
|
|
<StickyColumnHeaderCell width="1">
|
2025-10-14 21:36:37 -05:00
|
|
|
{strings.website.tools.playlist.table.wins}
|
2025-10-14 12:11:31 -05:00
|
|
|
</StickyColumnHeaderCell>
|
|
|
|
|
|
2025-10-14 12:19:28 -05:00
|
|
|
<StickyColumnHeaderCell width="1">
|
|
|
|
|
{strings.website.tools.playlist.table.battles}
|
|
|
|
|
</StickyColumnHeaderCell>
|
|
|
|
|
|
2025-10-14 21:36:37 -05:00
|
|
|
<StickyColumnHeaderCell width="1">
|
|
|
|
|
{strings.website.tools.playlist.table.last_played}
|
|
|
|
|
</StickyColumnHeaderCell>
|
2025-10-14 12:11:31 -05:00
|
|
|
</Table.Row>
|
|
|
|
|
</Table.Header>
|
|
|
|
|
|
|
|
|
|
<Table.Body>
|
|
|
|
|
{list.map((props, index) => (
|
2025-10-14 21:36:37 -05:00
|
|
|
<PlaylistTankEntry key={props.id} index={index} {...props} />
|
2025-10-14 12:11:31 -05:00
|
|
|
))}
|
|
|
|
|
</Table.Body>
|
|
|
|
|
</StickyTableRoot>
|
|
|
|
|
);
|
|
|
|
|
}
|