File tree Expand file tree Collapse file tree 6 files changed +57
-37
lines changed
Expand file tree Collapse file tree 6 files changed +57
-37
lines changed Original file line number Diff line number Diff line change 1- <script lang =" ts" module >
2- import type { UserResource } from ' @clerk/types' ;
3- import { data } from ' @/lib/components/sidebar/sampleData' ;
4- </script >
5-
61<script lang =" ts" >
72 import NavMain from ' @/lib/components/sidebar/NavMain.svelte' ;
83 import NavProjects from ' @/lib/components/sidebar/NavProjects.svelte' ;
116 import * as Sidebar from ' @/lib/components/ui/sidebar/index.js' ;
127 import type { ComponentProps } from ' svelte' ;
138
9+ import type { UserResource } from ' @clerk/types' ;
10+ import { data } from ' @/lib/components/sidebar/sampleData' ;
11+
1412 let {
1513 ref = $bindable (null ),
1614 collapsible = ' icon' ,
Original file line number Diff line number Diff line change 1+ <script lang =" ts" module >
2+ export type NavItems = {
3+ title: string ;
4+ url: string ;
5+ icon? : any ;
6+ isActive? : boolean ;
7+ items? : {
8+ title: string ;
9+ url: string ;
10+ }[];
11+ };
12+ </script >
13+
114<script lang =" ts" >
215 import * as Collapsible from ' @/lib/components/ui/collapsible/index.js' ;
316 import * as Sidebar from ' @/lib/components/ui/sidebar/index.js' ;
417 import ChevronRight from ' @lucide/svelte/icons/chevron-right' ;
518
6- let {
7- items
8- }: {
9- items: {
10- title: string ;
11- url: string ;
12- // this should be `Component` after @lucide/svelte updates types
13- // eslint-disable-next-line @typescript-eslint/no-explicit-any
14- icon? : any ;
15- isActive? : boolean ;
16- items? : {
17- title: string ;
18- url: string ;
19- }[];
20- }[];
21- } = $props ();
19+ type Props = {
20+ items: NavItems [];
21+ };
22+
23+ let { items }: Props = $props ();
2224 </script >
2325
2426<Sidebar .Group >
Original file line number Diff line number Diff line change 1+ <script lang =" ts" module >
2+ export type NavProject = {
3+ name: string ;
4+ url: string ;
5+ icon: any ;
6+ };
7+ </script >
8+
19<script lang =" ts" >
210 import * as DropdownMenu from ' @/lib/components/ui/dropdown-menu/index.js' ;
311 import { useSidebar } from ' @/lib/components/ui/sidebar/context.svelte.js' ;
715 import Forward from ' @lucide/svelte/icons/forward' ;
816 import Trash2 from ' @lucide/svelte/icons/trash-2' ;
917
10- let {
11- projects
12- }: {
13- projects: {
14- name: string ;
15- url: string ;
16- // This should be `Component` after @lucide/svelte updates types
17- // eslint-disable-next-line @typescript-eslint/no-explicit-any
18- icon: any ;
19- }[];
20- } = $props ();
18+ type Props = {
19+ projects: NavProject [];
20+ };
21+
22+ let { projects }: Props = $props ();
2123
2224 const sidebar = useSidebar ();
2325 </script >
Original file line number Diff line number Diff line change 1+ <script lang =" ts" module >
2+ export type NavUser = { name: string ; email: string ; avatar: string };
3+ </script >
4+
15<script lang =" ts" >
26 import * as Avatar from ' @/lib/components/ui/avatar/index.js' ;
37 import * as DropdownMenu from ' @/lib/components/ui/dropdown-menu/index.js' ;
1014 import LogOut from ' @lucide/svelte/icons/log-out' ;
1115 import Sparkles from ' @lucide/svelte/icons/sparkles' ;
1216
13- let { user }: { user: { name: string ; email: string ; avatar: string } } = $props ();
17+ type Props = {
18+ user: NavUser ;
19+ };
20+
21+ let { user }: Props = $props ();
1422 const sidebar = useSidebar ();
1523 </script >
1624
Original file line number Diff line number Diff line change 1+ <script lang =" ts" module >
2+ export type Team = {
3+ name: string ;
4+ logo: any ;
5+ plan: string ;
6+ };
7+ </script >
8+
19<script lang =" ts" >
210 import * as DropdownMenu from ' @/lib/components/ui/dropdown-menu/index.js' ;
311 import * as Sidebar from ' @/lib/components/ui/sidebar/index.js' ;
412 import { useSidebar } from ' @/lib/components/ui/sidebar/index.js' ;
513 import ChevronsUpDown from ' @lucide/svelte/icons/chevrons-up-down' ;
614 import Plus from ' @lucide/svelte/icons/plus' ;
715
8- // This should be `Component` after @lucide/svelte updates types
9- // eslint-disable-next-line @typescript-eslint/no-explicit-any
10- let { teams }: { teams: { name: string ; logo: any ; plan: string }[] } = $props ();
16+ type Props = {
17+ teams: Team [];
18+ };
19+
20+ let { teams }: Props = $props ();
1121 const sidebar = useSidebar ();
1222
1323 let activeTeam = $state (teams [0 ]);
Original file line number Diff line number Diff line change @@ -124,7 +124,7 @@ export const data = {
124124 {
125125 name : 'Travel' ,
126126 url : '#' ,
127- icon : Map
127+ icon : icons . Map
128128 }
129129 ]
130130} ;
You can’t perform that action at this time.
0 commit comments