main
vue 58 lines 1.14 KB
Raw
1 <!-- filepath: /Users/taylor/Desktop/Repos/CoPilot/frontend/src/components/common/AccessDenied.vue -->
2 <template>
3 <div class="access-denied-container">
4 <n-result
5 status="403"
6 title="Access Denied"
7 :description="description || 'You do not have permission to view this page.'"
8 >
9 <template #footer>
10 <n-space justify="center">
11 <n-button type="primary" @click="goBack">
12 <template #icon>
13 <Icon name="carbon:arrow-left" />
14 </template>
15 Go Back
16 </n-button>
17 <n-button @click="goHome">
18 <template #icon>
19 <Icon name="carbon:home" />
20 </template>
21 Go to Dashboard
22 </n-button>
23 </n-space>
24 </template>
25 </n-result>
26 </div>
27 </template>
28
29 <script setup lang="ts">
30 // TODO-FE: refactor
31 import { useRouter } from "vue-router"
32 import Icon from "@/components/common/Icon.vue"
33
34 interface Props {
35 description?: string
36 }
37
38 defineProps<Props>()
39
40 const router = useRouter()
41
42 function goBack() {
43 router.back()
44 }
45
46 function goHome() {
47 router.push("/")
48 }
49 </script>
50
51 <style scoped>
52 .access-denied-container {
53 display: flex;
54 align-items: center;
55 justify-content: center;
56 min-height: 60vh;
57 }
58 </style>