feat: init tools page (#271)

This commit is contained in:
Hayden 2023-02-10 19:38:50 -09:00 committed by GitHub
parent ab22ea6a25
commit 6ff2d64996
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 194 additions and 129 deletions

View file

@ -53,11 +53,16 @@
);
function setFile(e: Event) {
importCsv.value = e.target.files[0];
const result = e.target as HTMLInputElement;
if (!result.files || result.files.length === 0) {
return;
}
importCsv.value = result.files[0];
}
function uploadCsv() {
importRef.value.click();
importRef.value?.click();
}
const eventBus = useEventBus();
@ -86,5 +91,7 @@
}
eventBus.emit(EventTypes.InvalidStores);
toast.success("Import successful!");
}
</script>

View file

@ -0,0 +1,17 @@
<template>
<div class="grid grid-cols-1 md:grid-cols-4 gap-10 py-6">
<div class="col-span-3">
<h4 class="mb-1 text-lg font-semibold">
<slot name="title"></slot>
</h4>
<p class="text-sm">
<slot></slot>
</p>
</div>
<BaseButton class="btn-primary mt-auto" @click="$emit('action')">
<slot name="button">
<slot name="title"></slot>
</slot>
</BaseButton>
</div>
</template>