@wishbone-media/spark 0.10.0 → 0.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wishbone-media/spark",
3
- "version": "0.10.0",
3
+ "version": "0.12.0",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",
@@ -12,12 +12,14 @@
12
12
  />
13
13
  </div>
14
14
  </div>
15
- <div
15
+ <a
16
16
  v-for="app in appsWithCurrent"
17
17
  :key="app.name"
18
+ :href="app.href"
19
+ target="_blank"
18
20
  :class="app.current ? 'bg-gray-50' : 'hover:bg-gray-50'"
19
21
  class="flex px-[22px] py-[15px] cursor-pointer"
20
- @click="openNewTab(app)"
22
+ @click="app.current ? $event.preventDefault() : handleAppClick(app, $event)"
21
23
  >
22
24
  <div class="gap-y-1">
23
25
  <div class="text-base text-gray-800 flex items-center">
@@ -38,12 +40,21 @@
38
40
  class="h-5 w-5 shrink-0"
39
41
  />
40
42
  </div>
41
- </div>
43
+ </a>
42
44
  <div></div>
43
45
  </div>
44
46
  <div class="mt-auto">
45
- <div class="p-6">Learn More</div>
46
- <div class="bg-gray-50 p-6">Footer</div>
47
+ <div v-if="$slots.bottom || bottomSlot" class="p-6">
48
+ <slot name="bottom">
49
+ <component v-if="bottomSlot" :is="bottomSlot" />
50
+ </slot>
51
+ </div>
52
+
53
+ <div v-if="$slots.footer || footerSlot" class="bg-gray-50 p-6">
54
+ <slot name="footer">
55
+ <component v-if="footerSlot" :is="footerSlot" />
56
+ </slot>
57
+ </div>
47
58
  </div>
48
59
  </div>
49
60
  </div>
@@ -52,69 +63,34 @@
52
63
  <script setup>
53
64
  import { computed } from 'vue'
54
65
  import { Icons } from '@/plugins/fontawesome'
66
+ import { useSparkAppSelectorStore } from '@/stores/app-selector'
67
+ import { useSparkAppStore } from '@/stores/app'
55
68
 
56
69
  const props = defineProps({
57
- appItems: {
58
- type: Array,
59
- default() {
60
- return [
61
- {
62
- name: '3CX',
63
- description: 'VOIP Phone',
64
- href: 'https://3cx.letsbolt.com.au',
65
- icon: 'farLaptopMobile',
66
- },
67
- {
68
- name: 'Buzz',
69
- description: 'Communication on the go',
70
- href: 'https://buzz.letsbolt.com.au',
71
- icon: 'farSatelliteDish',
72
- },
73
- {
74
- name: 'Dash',
75
- description: 'Financial powerhouse',
76
- href: 'https://dash.letsbolt.com.au',
77
- icon: 'farScaleBalanced',
78
- },
79
- {
80
- name: 'MAPit',
81
- description: 'Geolocation everything',
82
- href: 'https://mapit.letsbolt.com.au',
83
- icon: 'farStreetView',
84
- },
85
- {
86
- name: 'ProspectR',
87
- description: 'Leads management',
88
- href: 'https://prospectr.letsbolt.com.au',
89
- icon: 'farFaceSmileRelaxed',
90
- },
91
- {
92
- name: 'ReVuze',
93
- description: 'Get Customer feedback',
94
- href: 'https://revuze.letsbolt.com.au',
95
- icon: 'farComments',
96
- },
97
- ]
98
- },
70
+ bottomSlot: {
71
+ type: [Object, Function],
72
+ default: null,
99
73
  },
100
- currentApp: {
101
- type: String,
102
- default: 'Buzz',
74
+ footerSlot: {
75
+ type: [Object, Function],
76
+ default: null,
103
77
  },
104
78
  })
105
79
 
106
80
  const emit = defineEmits(['close', 'select'])
107
81
 
82
+ const appSelectorStore = useSparkAppSelectorStore()
83
+ const appStore = useSparkAppStore()
84
+
108
85
  const appsWithCurrent = computed(() => {
109
- return props.appItems.map(app => ({
86
+ const currentAppName = appStore.state.app
87
+ return appSelectorStore.state.apps.map(app => ({
110
88
  ...app,
111
- current: app.name === props.currentApp
89
+ current: currentAppName && app.name.toLowerCase() === currentAppName.toLowerCase()
112
90
  }))
113
91
  })
114
92
 
115
- const openNewTab = (app) => {
116
- window.open(app.href, '_blank')
117
-
93
+ const handleAppClick = (app, event) => {
118
94
  emit('select', app)
119
95
  }
120
96
  </script>
@@ -10,7 +10,7 @@
10
10
  class="grid w-[40px] h-[40px] place-items-center rounded-md bg-primary-600 text-white text-[13px] cursor-pointer"
11
11
  @click.prevent="mainNavStore.goto(appStore.state.homeRoute)"
12
12
  >
13
- <font-awesome-icon :icon="Icons[appStore.state.icon]" class="size-5" />
13
+ <font-awesome-icon :icon="Icons[appIcon]" class="size-5" />
14
14
  </a>
15
15
  <a
16
16
  @click.prevent="mainNavStore.goto(appStore.state.homeRoute)"
@@ -165,11 +165,12 @@
165
165
  </template>
166
166
 
167
167
  <script setup>
168
- import { computed } from 'vue'
168
+ import { computed, h, useSlots } from 'vue'
169
169
  import {
170
170
  SparkOverlay,
171
171
  SparkBrandSelector,
172
172
  useSparkBrandFilterStore,
173
+ useSparkAppSelectorStore,
173
174
  SparkAppSelector,
174
175
  sparkOverlayService,
175
176
  SparkModalContainer,
@@ -185,14 +186,38 @@ const props = defineProps({
185
186
  type: Object,
186
187
  required: true,
187
188
  },
189
+ appSelectorSlots: {
190
+ type: Object,
191
+ default: () => ({}),
192
+ },
188
193
  })
189
194
 
195
+ const slots = useSlots()
196
+
190
197
  const sparkBrandFilterStore = useSparkBrandFilterStore()
198
+ const sparkAppSelectorStore = useSparkAppSelectorStore()
199
+
200
+ const appIcon = computed(() => {
201
+ return sparkAppSelectorStore.getAppIcon(props.appStore.state.app)
202
+ })
191
203
 
192
204
  const toggleAppSelector = () => {
193
- sparkOverlayService.showRight(SparkAppSelector, {
194
- currentApp: props.appStore.state.app,
195
- })
205
+ // Create component wrappers for slots if they exist
206
+ const slotProps = {}
207
+
208
+ if (slots['app-selector-bottom']) {
209
+ slotProps.bottomSlot = () => h('div', {}, slots['app-selector-bottom']())
210
+ } else if (props.appSelectorSlots.bottomSlot) {
211
+ slotProps.bottomSlot = props.appSelectorSlots.bottomSlot
212
+ }
213
+
214
+ if (slots['app-selector-footer']) {
215
+ slotProps.footerSlot = () => h('div', {}, slots['app-selector-footer']())
216
+ } else if (props.appSelectorSlots.footerSlot) {
217
+ slotProps.footerSlot = props.appSelectorSlots.footerSlot
218
+ }
219
+
220
+ sparkOverlayService.showRight(SparkAppSelector, slotProps)
196
221
  }
197
222
 
198
223
  const toggleBrandSelector = () => {
@@ -42,7 +42,7 @@ export function createAxiosInstance(config = {}) {
42
42
  },
43
43
  )
44
44
 
45
- // Response interceptor - handle 401 errors (unauthorized)
45
+ // Response interceptor - handle 401 and 403 errors
46
46
  instance.interceptors.response.use(
47
47
  (response) => response,
48
48
  async (error) => {
@@ -60,6 +60,20 @@ export function createAxiosInstance(config = {}) {
60
60
  window.location.href = '/login'
61
61
  }
62
62
  }
63
+
64
+ // Redirect on 403 Forbidden responses
65
+ if (error.response?.status === 403) {
66
+ try {
67
+ const authStore = useSparkAuthStore()
68
+ // Redirect to forbidden page
69
+ window.location.href = authStore.state.routes.forbidden
70
+ } catch (redirectError) {
71
+ // If redirect fails, fallback to default forbidden route
72
+ console.error('Error during 403 redirect:', redirectError)
73
+ window.location.href = '/error/403'
74
+ }
75
+ }
76
+
63
77
  return Promise.reject(error)
64
78
  },
65
79
  )
@@ -1,3 +1,3 @@
1
1
  export { Icons, addIcons, setupFontAwesome } from './fontawesome.js'
2
- export { createAuthRoutes, setupAuthGuards } from './router.js'
2
+ export { createAuthRoutes, setupAuthGuards, create403Route, create404Route } from './router.js'
3
3
  export { createAxiosInstance, setupAxios } from './axios.js'
@@ -4,6 +4,9 @@ import {
4
4
  SparkLogoutView,
5
5
  SparkForgotPasswordView,
6
6
  SparkResetPasswordView,
7
+ SparkError403View,
8
+ SparkError404View,
9
+ SparkErrorGeneralView,
7
10
  } from '../views/index.js'
8
11
 
9
12
  export function createAuthRoutes(options = {}) {
@@ -11,7 +14,7 @@ export function createAuthRoutes(options = {}) {
11
14
  loginPath = '/login',
12
15
  logoutPath = '/logout',
13
16
  forgotPasswordPath = '/forgot-password',
14
- resetPasswordPath = '/reset-password',
17
+ resetPasswordPath = '/password/reset',
15
18
  logo = '',
16
19
  defaultRedirect = '/dashboard',
17
20
  } = options
@@ -40,7 +43,7 @@ export function createAuthRoutes(options = {}) {
40
43
  },
41
44
  {
42
45
  path: resetPasswordPath,
43
- name: 'reset-password',
46
+ name: 'password-reset',
44
47
  component: SparkResetPasswordView,
45
48
  props: { logo, loginRoute: loginPath },
46
49
  meta: { auth: false },
@@ -126,3 +129,52 @@ function processNavigation(to, next, authStore, defaultAuthenticatedRoute) {
126
129
  next()
127
130
  }
128
131
  }
132
+
133
+ /**
134
+ * Creates error page route for 403 Forbidden
135
+ * NOTE: 404 catch-all route is separate - use create404Route() and add it LAST
136
+ * NOTE: General error page is available as SparkErrorGeneralView component for manual use
137
+ * @param {Object} options - Configuration options
138
+ * @param {string} options.forbiddenPath - Path for 403 forbidden page (default: '/error/403')
139
+ * @param {string} options.logo - Logo URL to display on error page
140
+ * @param {string} options.homeRoute - Default route for "Go Home" button (default: '/dashboard')
141
+ * @returns {Object} Route configuration for 403 error page
142
+ */
143
+ export function create403Route(options = {}) {
144
+ const {
145
+ forbiddenPath = '/error/403',
146
+ logo = '',
147
+ homeRoute = '/dashboard',
148
+ } = options
149
+
150
+ return {
151
+ path: forbiddenPath,
152
+ name: 'error-403',
153
+ component: SparkError403View,
154
+ props: { logo, homeRoute },
155
+ meta: { auth: false },
156
+ }
157
+ }
158
+
159
+ /**
160
+ * Creates 404 catch-all route
161
+ * IMPORTANT: This MUST be added as the last route in your router configuration
162
+ * @param {Object} options - Configuration options
163
+ * @param {string} options.logo - Logo URL to display on error page
164
+ * @param {string} options.homeRoute - Default route for "Go Home" button (default: '/dashboard')
165
+ * @returns {Object} Route configuration for 404 catch-all
166
+ */
167
+ export function create404Route(options = {}) {
168
+ const {
169
+ logo = '',
170
+ homeRoute = '/dashboard',
171
+ } = options
172
+
173
+ return {
174
+ path: '/:pathMatch(.*)*',
175
+ name: 'error-404',
176
+ component: SparkError404View,
177
+ props: { logo, homeRoute },
178
+ meta: { auth: false },
179
+ }
180
+ }
@@ -0,0 +1,140 @@
1
+ import { defineStore } from 'pinia'
2
+ import { computed, reactive } from 'vue'
3
+
4
+ const DEFAULT_APPS = [
5
+ {
6
+ name: '3CX',
7
+ description: 'VOIP Phone',
8
+ href: 'https://tmrg.3cx.com.au:5001/webclient',
9
+ icon: 'farLaptopMobile',
10
+ },
11
+ {
12
+ name: 'Buzz',
13
+ description: 'Communication on the go',
14
+ href: 'https://buzz-next.letsbolt.io',
15
+ icon: 'farSatelliteDish',
16
+ },
17
+ {
18
+ name: 'Dash',
19
+ description: 'Financial powerhouse',
20
+ href: 'https://dash-next.letsbolt.io',
21
+ icon: 'farScaleBalanced',
22
+ },
23
+ {
24
+ name: 'MAPit',
25
+ description: 'Geolocation everything',
26
+ href: 'https://mapit-next.letsbolt.io',
27
+ icon: 'farStreetView',
28
+ },
29
+ {
30
+ name: 'ProspectR',
31
+ description: 'Leads management',
32
+ href: 'https://prospectr-next.letsbolt.io',
33
+ icon: 'farFaceSmileRelaxed',
34
+ },
35
+ {
36
+ name: 'ReVuze',
37
+ description: 'Get Customer feedback',
38
+ href: 'https://revuze-next.letsbolt.io',
39
+ icon: 'farComments',
40
+ },
41
+ {
42
+ name: 'Tabula',
43
+ description: 'Admin interface',
44
+ href: 'https://tabula.letsbolt.io',
45
+ icon: 'farCompass',
46
+ },
47
+ ]
48
+
49
+ export const useSparkAppSelectorStore = defineStore('sparkAppSelector', () => {
50
+ const state = reactive({
51
+ apps: [...DEFAULT_APPS],
52
+ })
53
+
54
+ /**
55
+ * Initialize app selector store with either partial href config or full app override
56
+ * @param {Object} config - Configuration object
57
+ * @param {Object} config.appHrefs - Object mapping app names to hrefs (case-insensitive)
58
+ * Example: { 'Buzz': 'https://buzz.staging.example.com' }
59
+ * @param {Array} config.apps - Complete array of app objects to override defaults
60
+ * Example: [{ name: 'Buzz', description: '...', icon: '...', href: '...' }]
61
+ */
62
+ const initialize = (config = {}) => {
63
+ // Full override: if apps array is provided, use it entirely
64
+ if (config.apps && Array.isArray(config.apps)) {
65
+ const validApps = config.apps.filter((app) => {
66
+ const isValid = app.name && app.description && app.icon && app.href
67
+ if (!isValid) {
68
+ console.warn('useSparkAppSelectorStore: Invalid app object', app)
69
+ }
70
+ return isValid
71
+ })
72
+
73
+ state.apps = validApps.map((app) => ({
74
+ name: app.name,
75
+ description: app.description,
76
+ icon: app.icon,
77
+ href: app.href,
78
+ }))
79
+
80
+ return
81
+ }
82
+
83
+ // Partial config: merge appHrefs into defaults
84
+ if (config.appHrefs && typeof config.appHrefs === 'object') {
85
+ // Create a case-insensitive lookup map
86
+ const hrefMap = new Map()
87
+ Object.keys(config.appHrefs).forEach((appName) => {
88
+ hrefMap.set(appName.toLowerCase(), config.appHrefs[appName])
89
+ })
90
+
91
+ // Update default apps with provided hrefs
92
+ state.apps = DEFAULT_APPS.map((app) => {
93
+ const customHref = hrefMap.get(app.name.toLowerCase())
94
+ return {
95
+ ...app,
96
+ href: customHref || app.href,
97
+ }
98
+ })
99
+
100
+ return
101
+ }
102
+
103
+ // No config provided: use defaults
104
+ state.apps = [...DEFAULT_APPS]
105
+ }
106
+
107
+ /**
108
+ * Get all available apps
109
+ */
110
+ const allApps = computed(() => state.apps)
111
+
112
+ /**
113
+ * Get app by name (case-insensitive)
114
+ * @param {string} appName - Name of the app to find
115
+ * @returns {Object|null} App object or null if not found
116
+ */
117
+ const getAppByName = (appName) => {
118
+ if (!appName) return null
119
+ const normalizedName = appName.toLowerCase()
120
+ return state.apps.find((app) => app.name.toLowerCase() === normalizedName) || null
121
+ }
122
+
123
+ /**
124
+ * Get icon for a specific app (case-insensitive)
125
+ * @param {string} appName - Name of the app
126
+ * @returns {string} Icon name or empty string if not found
127
+ */
128
+ const getAppIcon = (appName) => {
129
+ const app = getAppByName(appName)
130
+ return app ? app.icon : ''
131
+ }
132
+
133
+ return {
134
+ state,
135
+ initialize,
136
+ allApps,
137
+ getAppByName,
138
+ getAppIcon,
139
+ }
140
+ })
package/src/stores/app.js CHANGED
@@ -4,7 +4,6 @@ import { reactive } from 'vue'
4
4
  export const useSparkAppStore = defineStore('sparkApp', () => {
5
5
  const state = reactive({
6
6
  app: '',
7
- icon: '',
8
7
  homeRoute: 'dashboard',
9
8
  showBrandSelector: true,
10
9
  showAppSelector: true,
@@ -12,7 +11,6 @@ export const useSparkAppStore = defineStore('sparkApp', () => {
12
11
 
13
12
  const initialize = (config = {}) => {
14
13
  state.app = config.app || ''
15
- state.icon = config.icon || ''
16
14
  state.homeRoute = config.homeRoute ?? 'dashboard'
17
15
  state.showBrandSelector = config.showBrandSelector ?? true
18
16
  state.showAppSelector = config.showAppSelector ?? true
@@ -1,4 +1,5 @@
1
1
  export * from './app.js'
2
+ export * from './app-selector.js'
2
3
  export * from './auth.js'
3
4
  export * from './brand-filter.js'
4
5
  export * from './navigation.js'
@@ -0,0 +1,70 @@
1
+ <template>
2
+ <div class="h-full grid place-content-center relative">
3
+ <div class="absolute top-8 left-8">
4
+ <img v-if="props.logo" :src="props.logo" alt="Logo" class="h-[23px] w-auto" />
5
+ <svg
6
+ v-else
7
+ width="59"
8
+ height="23"
9
+ viewBox="0 0 59 23"
10
+ fill="none"
11
+ xmlns="http://www.w3.org/2000/svg"
12
+ >
13
+ <path
14
+ d="M49.2029 17.1264V8.03835H44.0829V5.22235H58.0989V8.03835H52.9629V17.1264H49.2029Z"
15
+ fill="#1C64F2"
16
+ />
17
+ <path d="M34.5 5.22235H38.228V14.1664H46.5V17.1264H34.5V5.22235Z" fill="#1C64F2" />
18
+ <path
19
+ d="M28.3161 0C29.1499 0 29.7522 0.798785 29.5209 1.59757L27.1856 9.77748H30.9046C31.747 9.77748 32.4279 10.4584 32.4279 11.3008C32.4279 11.7504 32.2315 12.1738 31.891 12.4619L20.5989 22.0517C20.3719 22.2438 20.0839 22.3485 19.787 22.3485C18.9533 22.3485 18.351 21.5497 18.5823 20.751L20.9176 12.571H17.1463C16.33 12.571 15.6709 11.9119 15.6709 11.1001C15.6709 10.6679 15.8586 10.262 16.186 9.98263L27.5043 0.301181C27.7312 0.104759 28.0193 0 28.3161 0ZM26.7404 3.71021L18.8311 10.4759H22.3056C22.633 10.4759 22.9429 10.6286 23.1437 10.8905C23.3445 11.1524 23.4056 11.4929 23.3139 11.8072L21.3584 18.6601L29.355 11.8727H25.7976C25.4702 11.8727 25.1603 11.7199 24.9595 11.458C24.7587 11.1961 24.6976 10.8556 24.7893 10.5413L26.7404 3.71021Z"
20
+ fill="#1C64F2"
21
+ />
22
+ <path
23
+ d="M0 17.1264V5.22235H10.192C13.6 5.22235 14.544 6.53435 14.544 7.94235V8.16635C14.544 9.70235 13.232 10.3264 12.656 10.4864C13.472 10.6944 15.216 11.3984 15.216 13.4784V13.7024C15.216 15.5904 14.144 17.1264 10.288 17.1264H0ZM9.552 7.73435H3.728V9.67035H9.552C10.592 9.67035 10.848 9.19035 10.848 8.71035V8.67835C10.848 8.18235 10.592 7.73435 9.552 7.73435ZM9.872 12.1984H3.728V14.5344H9.872C11.12 14.5344 11.344 13.8464 11.344 13.3664V13.3024C11.344 12.7904 11.104 12.1984 9.872 12.1984Z"
24
+ fill="#1C64F2"
25
+ />
26
+ </svg>
27
+ </div>
28
+
29
+ <div class="max-w-lg grid gap-y-6 text-center -mt-8">
30
+ <div>
31
+ <div class="text-primary-600 text-7xl font-bold mb-4">403</div>
32
+ <h1 class="text-3xl text-gray-900 font-semibold tracking-tight mb-3">
33
+ Access Forbidden
34
+ </h1>
35
+ <p class="text-gray-600">
36
+ You don't have permission to access this resource.<br>
37
+ If you believe this is an error, please contact your administrator.
38
+ </p>
39
+ </div>
40
+
41
+ <div class="flex gap-4 justify-center">
42
+ <spark-button @click="goHome" size="lg">
43
+ Go to Home
44
+ </spark-button>
45
+ </div>
46
+ </div>
47
+ </div>
48
+ </template>
49
+
50
+ <script setup>
51
+ import { useRouter } from 'vue-router'
52
+ import { SparkButton } from '@/index.js'
53
+
54
+ const router = useRouter()
55
+
56
+ const props = defineProps({
57
+ logo: {
58
+ type: String,
59
+ default: '',
60
+ },
61
+ homeRoute: {
62
+ type: String,
63
+ default: '/dashboard',
64
+ },
65
+ })
66
+
67
+ const goHome = () => {
68
+ router.push(props.homeRoute)
69
+ }
70
+ </script>
@@ -0,0 +1,69 @@
1
+ <template>
2
+ <div class="h-full grid place-content-center relative">
3
+ <div class="absolute top-8 left-8">
4
+ <img v-if="props.logo" :src="props.logo" alt="Logo" class="h-[23px] w-auto" />
5
+ <svg
6
+ v-else
7
+ width="59"
8
+ height="23"
9
+ viewBox="0 0 59 23"
10
+ fill="none"
11
+ xmlns="http://www.w3.org/2000/svg"
12
+ >
13
+ <path
14
+ d="M49.2029 17.1264V8.03835H44.0829V5.22235H58.0989V8.03835H52.9629V17.1264H49.2029Z"
15
+ fill="#1C64F2"
16
+ />
17
+ <path d="M34.5 5.22235H38.228V14.1664H46.5V17.1264H34.5V5.22235Z" fill="#1C64F2" />
18
+ <path
19
+ d="M28.3161 0C29.1499 0 29.7522 0.798785 29.5209 1.59757L27.1856 9.77748H30.9046C31.747 9.77748 32.4279 10.4584 32.4279 11.3008C32.4279 11.7504 32.2315 12.1738 31.891 12.4619L20.5989 22.0517C20.3719 22.2438 20.0839 22.3485 19.787 22.3485C18.9533 22.3485 18.351 21.5497 18.5823 20.751L20.9176 12.571H17.1463C16.33 12.571 15.6709 11.9119 15.6709 11.1001C15.6709 10.6679 15.8586 10.262 16.186 9.98263L27.5043 0.301181C27.7312 0.104759 28.0193 0 28.3161 0ZM26.7404 3.71021L18.8311 10.4759H22.3056C22.633 10.4759 22.9429 10.6286 23.1437 10.8905C23.3445 11.1524 23.4056 11.4929 23.3139 11.8072L21.3584 18.6601L29.355 11.8727H25.7976C25.4702 11.8727 25.1603 11.7199 24.9595 11.458C24.7587 11.1961 24.6976 10.8556 24.7893 10.5413L26.7404 3.71021Z"
20
+ fill="#1C64F2"
21
+ />
22
+ <path
23
+ d="M0 17.1264V5.22235H10.192C13.6 5.22235 14.544 6.53435 14.544 7.94235V8.16635C14.544 9.70235 13.232 10.3264 12.656 10.4864C13.472 10.6944 15.216 11.3984 15.216 13.4784V13.7024C15.216 15.5904 14.144 17.1264 10.288 17.1264H0ZM9.552 7.73435H3.728V9.67035H9.552C10.592 9.67035 10.848 9.19035 10.848 8.71035V8.67835C10.848 8.18235 10.592 7.73435 9.552 7.73435ZM9.872 12.1984H3.728V14.5344H9.872C11.12 14.5344 11.344 13.8464 11.344 13.3664V13.3024C11.344 12.7904 11.104 12.1984 9.872 12.1984Z"
24
+ fill="#1C64F2"
25
+ />
26
+ </svg>
27
+ </div>
28
+
29
+ <div class="max-w-lg grid gap-y-6 text-center -mt-8">
30
+ <div>
31
+ <div class="text-primary-600 text-7xl font-bold mb-4">404</div>
32
+ <h1 class="text-3xl text-gray-900 font-semibold tracking-tight mb-3">
33
+ Page Not Found
34
+ </h1>
35
+ <p class="text-gray-600">
36
+ The page you're looking for doesn't exist or has been moved.
37
+ </p>
38
+ </div>
39
+
40
+ <div class="flex gap-4 justify-center">
41
+ <spark-button @click="goHome" size="lg">
42
+ Go to Home
43
+ </spark-button>
44
+ </div>
45
+ </div>
46
+ </div>
47
+ </template>
48
+
49
+ <script setup>
50
+ import { useRouter } from 'vue-router'
51
+ import { SparkButton } from '@/index.js'
52
+
53
+ const router = useRouter()
54
+
55
+ const props = defineProps({
56
+ logo: {
57
+ type: String,
58
+ default: '',
59
+ },
60
+ homeRoute: {
61
+ type: String,
62
+ default: '/dashboard',
63
+ },
64
+ })
65
+
66
+ const goHome = () => {
67
+ router.push(props.homeRoute)
68
+ }
69
+ </script>