11import { component$ , useSignal } from "@builder.io/qwik" ;
2- import {
3- CalendarIcon as Calendar ,
4- UserPlusIcon as UserPlus ,
5- HeartIcon as Heart ,
6- } from "lucide-qwik" ;
2+
73import type { DetailedEventType , PlaceType } from "~/routes/profile/types" ;
84import { EventCard } from "./EventCard" ;
95import { PlaceCard } from "./PlaceCard" ;
10- import { EmptyState } from "./EmptyState" ;
116
127interface TabsSectionProps {
138 upcomingEvents : DetailedEventType [ ] ;
@@ -46,28 +41,24 @@ export const TabsSection = component$<TabsSectionProps>(
4641 const tabs : {
4742 id : string ;
4843 label : string ;
49- icon : any ;
5044 count : number ;
5145 } [ ] = [
52- {
53- id : "upcoming" ,
54- label : "Upcoming" ,
55- icon : Calendar ,
56- count : upcomingEvents . length ,
57- } ,
58- {
59- id : "hosted" ,
60- label : "Hosted" ,
61- icon : UserPlus ,
62- count : hostedEvents . length ,
63- } ,
64- {
65- id : "saved" ,
66- label : "Saved Places" ,
67- icon : Heart ,
68- count : savedPlaces . length ,
69- } ,
70- ] ;
46+ {
47+ id : "upcoming" ,
48+ label : "Upcoming" ,
49+ count : upcomingEvents . length ,
50+ } ,
51+ {
52+ id : "hosted" ,
53+ label : "Hosted" ,
54+ count : hostedEvents . length ,
55+ } ,
56+ {
57+ id : "saved" ,
58+ label : "Saved Places" ,
59+ count : savedPlaces . length ,
60+ } ,
61+ ] ;
7162
7263 return (
7364 < div class = "w-full" >
@@ -80,37 +71,29 @@ export const TabsSection = component$<TabsSectionProps>(
8071 // Capture serializable values and component reference outside the JSX scope
8172 // to avoid potential serialization issues with the entire 'tab' object in onClick$.
8273 const tabId = tab . id ;
83- const TabIcon = tab . icon ;
8474 const tabLabel = tab . label ;
8575 const tabCount = tab . count ;
8676
8777 return (
8878 < button
8979 key = { tabId }
9080 onClick$ = { ( ) => ( activeTab . value = tabId ) } // Use captured primitive value
91- class = { `group inline-flex shrink-0 items-center whitespace-nowrap border-b-2 px-1 py-4 text-base font-medium transition-colors duration-150 ease-in-out focus:outline-none ${
92- activeTab . value === tabId // Use captured primitive value
93- ? "border-[#D98E73] text-[#C27B62]"
94- : "border-transparent text-[#6D5D4E] hover:border-gray-300 hover:text-[#5B3E29]"
95- } `}
81+ class = { `group inline-flex shrink-0 items-center whitespace-nowrap border-b-2 px-1 py-4 text-base font-medium transition-colors duration-150 ease-in-out focus:outline-none ${ activeTab . value === tabId // Use captured primitive value
82+ ? "border-[#D98E73] text-[#C27B62]"
83+ : "border-transparent text-[#6D5D4E] hover:border-gray-300 hover:text-[#5B3E29]"
84+ } `}
9685 aria-current = { activeTab . value === tabId ? "page" : undefined } // Use captured primitive value
9786 >
98- < TabIcon // Render the component directly
99- class = { `mr-2 h-5 w-5 ${
100- activeTab . value === tabId // Use captured primitive value
101- ? "text-[#D98E73]"
102- : "text-gray-400 group-hover:text-gray-500"
103- } `}
104- aria-hidden = "true"
105- />
87+
88+
89+
10690 < span > { tabLabel } </ span >
10791 { tabCount > 0 && (
10892 < span
109- class = { `ml-2.5 hidden rounded-full px-2.5 py-1 text-xs font-semibold md:inline-block ${
110- activeTab . value === tabId // Use captured primitive value
111- ? "bg-[#FFF1E6] text-[#C27B62]"
112- : "bg-gray-100 text-gray-600 group-hover:bg-gray-200"
113- } `}
93+ class = { `ml-2.5 hidden rounded-full px-2.5 py-1 text-xs font-semibold md:inline-block ${ activeTab . value === tabId // Use captured primitive value
94+ ? "bg-[#FFF1E6] text-[#C27B62]"
95+ : "bg-gray-100 text-gray-600 group-hover:bg-gray-200"
96+ } `}
11497 >
11598 { tabCount }
11699 </ span >
@@ -130,11 +113,7 @@ export const TabsSection = component$<TabsSectionProps>(
130113 ) ) }
131114 </ div >
132115 ) : (
133- < EmptyState
134- context = "CalendarIcon" // Use context instead of icon
135- title = "No Upcoming Events"
136- message = "You haven't joined or been invited to any events yet. Explore events to join!"
137- />
116+ < h1 class = "text-2xl font-bold text-center" > No joined events</ h1 >
138117 ) ) }
139118
140119 { activeTab . value === "hosted" &&
@@ -149,12 +128,7 @@ export const TabsSection = component$<TabsSectionProps>(
149128 ) ) }
150129 </ div >
151130 ) : (
152- < EmptyState
153- context = "UsersIcon" // Use context instead of icon (UserPlus mapped to UsersIcon context)
154- title = "No Hosted Events Yet"
155- message = "Ready to gather some folks? Host your first event and bring people together."
156- actionButton = { { label : "Host an Event" , href : "/create-event" } }
157- />
131+ < h1 class = "text-2xl font-bold text-center" > No Hosted Events</ h1 >
158132 ) ) }
159133
160134 { activeTab . value === "saved" &&
@@ -165,12 +139,7 @@ export const TabsSection = component$<TabsSectionProps>(
165139 ) ) }
166140 </ div >
167141 ) : (
168- < EmptyState
169- context = "MapPinIcon" // Use context instead of icon (Heart mapped to MapPinIcon context for places)
170- title = "No Saved Places"
171- message = "Discover and save your favorite spots to easily find them later."
172- actionButton = { { label : "Browse Spaces" , href : "/spaces" } } // Assuming a browse spaces route
173- />
142+ < h1 class = "text-2xl font-bold text-center" > No Saved Places</ h1 >
174143 ) ) }
175144 </ div >
176145 </ div >
0 commit comments