import {GameData} from "../_utils/game.ts"
import {GameRow, GameRowColumnKind, gameRowColumnKindDefault, GameRowColumnPriority} from "./GameRow.tsx"
export type GameTableProps = {
id?: string,
games: GameData[],
columns?: GameRowColumnKind[]
priority?: GameRowColumnPriority
}
export function GameTable({id, 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 "namesort": return (
Sort by
|
)
case "hascontent":
return (
|
)
case "date": return (
Date
|
)
case "hoursplayed": return (
Playtime
|
)
}
})
const trTdElements = games.map((game: GameData) => (
))
return (
{colElements}
{thElements}
{trTdElements}
)
}