/
ncit
/
c4panelmodel
Обзор
Документация
Войти
/
ncit
/
c4panelmodel
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
main
src/lib/components/layout/ProjectNav.svelte
59 строк
2 KB
ncit
feat: rewrite hooks.server.ts to use Supabase Auth
07 июн 2026, 19:32
07 июн 2026, 19:32
b6162ab
Код
Авторство
О чём код?
<script lang="ts"> import { page } from '$app/state'; import { LayoutDashboard, Boxes, Workflow, Tags, Cpu, History, MessageSquare, Settings, Share2, Download, Upload } from '@lucide/svelte'; interface Props { projectId: string; } let { projectId }: Props = $props(); const items = [ { slug: '', label: 'Overview', icon: LayoutDashboard, exact: true }, { slug: 'model', label: 'Model', icon: Boxes }, { slug: 'flows', label: 'Flows', icon: Workflow }, { slug: 'tags', label: 'Tags', icon: Tags }, { slug: 'technologies', label: 'Technologies', icon: Cpu }, { slug: 'versions', label: 'Versions', icon: History }, { slug: 'comments', label: 'Comments', icon: MessageSquare }, { slug: 'sharing', label: 'Sharing', icon: Share2 }, { slug: 'export', label: 'Export', icon: Download }, { slug: 'import', label: 'Import', icon: Upload }, { slug: 'settings', label: 'Settings', icon: Settings } ]; function href(slug: string) { return slug ? `/project/${projectId}/${slug}` : `/project/${projectId}`; } function active(slug: string, exact?: boolean) { const h = href(slug); return exact ? page.url.pathname === h : page.url.pathname === h; } </script> <nav class="flex flex-col gap-0.5"> {#each items as item} <a href={href(item.slug)} class="flex items-center gap-2.5 rounded-md px-2.5 py-1.5 text-sm font-medium transition-colors" class:bg-blue-50={active(item.slug, item.exact)} class:text-blue-700={active(item.slug, item.exact)} class:text-slate-600={!active(item.slug, item.exact)} class:hover:bg-slate-100={!active(item.slug, item.exact)} > <item.icon size={16} /> {item.label} </a> {/each} </nav>