anki/ts/graphs/NoDataOverlay.svelte
Damien Elmes c039845c16 use singleton + free functions for i18n in ts
This allows for tree shaking, and reduces the congrats page from 150k
with the old enum solution to about 80k.
2021-03-26 20:38:44 +10:00

25 lines
570 B
Svelte

<script lang="typescript">
import type { GraphBounds } from "./graph-helpers";
export let bounds: GraphBounds;
import * as tr from "anki/i18n";
const noData = tr.statisticsNoData();
</script>
<style lang="scss">
.no-data {
rect {
fill: var(--window-bg);
}
text {
text-anchor: middle;
fill: grey;
}
}
</style>
<g class="no-data">
<rect x="0" y="0" width={bounds.width} height={bounds.height} />
<text x="{bounds.width / 2}," y={bounds.height / 2}>{noData}</text>
</g>