nuxt-prawo-jazdy/components/ResultModal.vue

55 lines
1.4 KiB
Vue

<script setup lang="ts">
import { VueFinalModal } from "vue-final-modal";
defineProps<{
title?: string;
}>();
const emit = defineEmits<{
(e: "homepage"): void;
(e: "newExam"): void;
(e: "close"): void;
}>();
</script>
<template>
<VueFinalModal
class="flex justify-center items-center backdrop-blur-sm"
content-class="flex flex-col p-3 bg-white rounded-md gap-3"
overlay-transition="vfm-fade"
content-transition="vfm-fade"
:click-to-close="false"
:esc-to-close="false"
>
<h1 class="text-[1.5rem]">{{ title }}</h1>
<div class="*:inline">Punkty: <slot name="points" /> / 74</div>
<div class="*:inline">Wynik: pozytywny/negatywny</div>
<div
class="flex flex-row gap-2 *:py-1 *:px-3 *:border *:border-1 *:border-slate-300 *:rounded-md *:bg-slate-100"
>
<button class="text-slate-600" @click="emit('homepage')">
Wróć na stronę główną
</button>
<button class="border-slate-200 bg-slate-50" @click="emit('newExam')">
Rozpocznij jeszcze raz
</button>
<button
class="!border-slate-500 !bg-slate-700 text-white"
@click="emit('close')"
>
Przejrzyj odpowiedzi
</button>
</div>
</VueFinalModal>
</template>
<style>
.confirm-modal-content button {
padding: 0 8px;
border: 1px solid;
border-radius: 0.5rem;
}
.dark .confirm-modal-content {
background: #000;
}
</style>