Files
kycnotme/web/src/components/KarmaUnlocksTable.astro
2025-05-19 10:23:36 +00:00

31 lines
535 B
Plaintext

---
import { orderBy } from 'lodash-es'
import { karmaUnlocks } from '../constants/karmaUnlocks'
const karmaUnlocksSorted = orderBy(karmaUnlocks, [
({ karma }) => (karma >= 0 ? 1 : 2),
({ karma }) => Math.abs(karma),
'id',
])
---
<table>
<thead>
<tr>
<th>Karma</th>
<th>Unlock</th>
</tr>
</thead>
<tbody>
{
karmaUnlocksSorted.map((unlock) => (
<tr>
<td>{unlock.karma.toLocaleString()}</td>
<td>{unlock.name}</td>
</tr>
))
}
</tbody>
</table>