fix: add table styling

This commit is contained in:
Arvid Norlin
2024-06-03 14:51:25 +02:00
parent 92f5f7f7c0
commit 349c95fbc4
7 changed files with 126 additions and 61 deletions

View File

@@ -1,26 +1,46 @@
import Image from "@/components/Image"
import BenefitValue from "../BenefitValue"
import LevelSummary from "../LevelSummary"
import styles from "./largeTable.module.css"
import { LargeTableProps } from "@/types/components/loyalty/blocks"
export default function LargeTable({ levels }: LargeTableProps) {
return (
<table>
<thead>
<th />
{levels.map((level) => {
console.log({ level })
<table className={styles.table}>
<thead className={styles.thead}>
<tr>
<th />
{levels.map((level) => {
return (
<th key={level.tier} className={styles.th}>
<LevelSummary level={level} />
</th>
)
})}
</tr>
</thead>
<tbody>
{levels[0].benefits.map((benefit, index) => {
return (
<th key={level.tier}>
<Image
src={level.icon}
alt={level.name}
width={140}
height={54}
/>
</th>
<tr key={benefit.name} className={styles.tr}>
<th scope={"row"} className={styles.th}>
<span className={styles.benefitName}>{benefit.name}</span>
<span className={styles.benefitDescription}>
{benefit.description}
</span>
</th>
{levels.map((level) => {
return (
<td key={level.tier} className={styles.td}>
<BenefitValue benefit={level.benefits[index]} />
</td>
)
})}
</tr>
)
})}
</thead>
</tbody>
</table>
)
}