import {GameData} from "../_utils/game.ts"
import {GameRow, GameRowColumnKind, gameRowColumnKindDefault, GameRowColumnPriority} from "./GameRow.tsx"
export type GameTableProps = {
games: GameData[],
columns?: GameRowColumnKind[]
priority?: GameRowColumnPriority
}
export function GameTable({games, columns = gameRowColumnKindDefault, priority}: GameTableProps) {
const colElements = columns.map((column, index) => {
switch(column) {
case "rating": return (
)
case "progress": return (
)
case "name": return (
)
case "hascontent": return (
)
case "date": return (
)
case "hoursplayed": return (
)
}
})
const thElements = columns.map((column, index) => {
switch(column) {
case "rating": return (
|
)
case "progress": return (
|
)
case "name": return (
Title
|
)
case "hascontent": return (
|
)
case "date": return (
Date
|
)
case "hoursplayed": return (
Playtime
|
)
}
})
const trTdElements = games.map((game: GameData) => (
))
return (
{colElements}
{thElements}
{trTdElements}
)
}