c039845c16
This allows for tree shaking, and reduces the congrats page from 150k with the old enum solution to about 80k.
32 lines
638 B
Svelte
32 lines
638 B
Svelte
<script lang="typescript">
|
|
import type { TableDatum } from "./graph-helpers";
|
|
import { i18n } from "anki/i18n";
|
|
export let tableData: TableDatum[];
|
|
</script>
|
|
|
|
<style lang="scss">
|
|
div {
|
|
display: flex;
|
|
justify-content: center;
|
|
}
|
|
|
|
.align-end {
|
|
text-align: end;
|
|
}
|
|
|
|
.align-start {
|
|
text-align: start;
|
|
}
|
|
</style>
|
|
|
|
<div>
|
|
<table dir={i18n.direction()}>
|
|
{#each tableData as { label, value }}
|
|
<tr>
|
|
<td class="align-end">{label}:</td>
|
|
<td class="align-start">{value}</td>
|
|
</tr>
|
|
{/each}
|
|
</table>
|
|
</div>
|