Finish MVP

This commit is contained in:
2023-12-05 17:55:48 +01:00
parent 0fc220ce94
commit 224a3929aa
12 changed files with 270 additions and 10 deletions

View File

@@ -6,10 +6,12 @@
import type {SchematicInfo} from "../types/schem.ts";
import {createEventDispatcher} from "svelte";
import {schemRepo} from "../repo/repo.ts";
import type {Player} from "../types/data.ts";
const dispatch = createEventDispatcher();
export let info: SchematicInfo;
export let user: Player;
async function download() {
const code = await $schemRepo.createDownload(info.schem.id);
@@ -50,7 +52,9 @@
<p class="!mt-0">{t("dashboard.schematic.info.members", {members: info.members.join(", ")})}</p>
{/if}
<svelte:fragment slot="footer">
<button class="btn !ml-auto" on:click={download}>{t("dashboard.schematic.info.btn.download")}</button>
{#if (info.schem.owner === user.id)}
<button class="btn !ml-auto" on:click={download}>{t("dashboard.schematic.info.btn.download")}</button>
{/if}
<button class="btn" on:click={() => dispatch("reset")}>{t("dashboard.schematic.info.btn.close")}</button>
</svelte:fragment>
</Modal>