import { createRouter, createWebHistory, createMemoryHistory } from 'vue-router' import PlaceholderView from './views/PlaceholderView.vue' import SettingsView from './views/SettingsView.vue' import GalleryView from './views/GalleryView.vue' import ShowcaseView from './views/ShowcaseView.vue' import TagsView from './views/TagsView.vue' import ArtistView from './views/ArtistView.vue' // The application's front door. `/` redirects here. Changing the front door // is a one-line edit (e.g. '/gallery' or '/tags'). export const FRONT_DOOR = '/showcase' const routes = [ // Root is a redirect only — no meta.title so it stays out of the nav. { path: '/', redirect: FRONT_DOOR }, // FC-2: image backbone { path: '/showcase', name: 'showcase', component: ShowcaseView, meta: { title: 'Showcase' } }, { path: '/gallery', name: 'gallery', component: GalleryView, meta: { title: 'Gallery' } }, { path: '/tags', name: 'tags', component: TagsView, meta: { title: 'Tags' } }, // Artist detail — no meta.title (reached by clicking an artist, not nav). { path: '/artist/:slug', name: 'artist', component: ArtistView }, { path: '/settings', name: 'settings', component: SettingsView, meta: { title: 'Settings' } }, // FC-3: subscription backbone { path: '/subscriptions', name: 'subscriptions', component: PlaceholderView, meta: { title: 'Subscriptions' } }, { path: '/credentials', name: 'credentials', component: PlaceholderView, meta: { title: 'Credentials' } }, { path: '/downloads', name: 'downloads', component: PlaceholderView, meta: { title: 'Downloads' } } ] // Browser uses HTML5 history; non-browser (Vitest/SSR) falls back to memory // history so the module is importable without `window`. const history = typeof window !== 'undefined' ? createWebHistory() : createMemoryHistory() const router = createRouter({ history, routes }) export default router