diff --git a/src/app/motivators/[id]/page.tsx b/src/app/motivators/[id]/page.tsx index 6321117..b3f9744 100644 --- a/src/app/motivators/[id]/page.tsx +++ b/src/app/motivators/[id]/page.tsx @@ -29,7 +29,7 @@ export default async function MotivatorSessionPage({ params }: MotivatorSessionP {/* Header */}
- + Moving Motivators / diff --git a/src/app/page.tsx b/src/app/page.tsx index 3750837..13498f1 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -23,7 +23,7 @@ export default function Home() {
{/* SWOT Workshop Card */} { } export function WorkshopTabs({ swotSessions, motivatorSessions }: WorkshopTabsProps) { - const [activeTab, setActiveTab] = useState('all'); + const searchParams = useSearchParams(); + const router = useRouter(); + + // Get tab from URL or default to 'all' + const tabParam = searchParams.get('tab'); + const activeTab: WorkshopType = tabParam && VALID_TABS.includes(tabParam as WorkshopType) + ? (tabParam as WorkshopType) + : 'all'; + + const setActiveTab = (tab: WorkshopType) => { + const params = new URLSearchParams(searchParams.toString()); + if (tab === 'all') { + params.delete('tab'); + } else { + params.set('tab', tab); + } + router.push(`/sessions${params.toString() ? `?${params.toString()}` : ''}`); + }; // Combine and sort all sessions const allSessions: AnySession[] = [...swotSessions, ...motivatorSessions].sort( diff --git a/src/app/sessions/[id]/page.tsx b/src/app/sessions/[id]/page.tsx index 2f015ba..61faffc 100644 --- a/src/app/sessions/[id]/page.tsx +++ b/src/app/sessions/[id]/page.tsx @@ -30,8 +30,8 @@ export default async function SessionPage({ params }: SessionPageProps) { {/* Header */}
- - Mes Sessions + + SWOT / {session.title} diff --git a/src/app/sessions/page.tsx b/src/app/sessions/page.tsx index 2369f7a..e77b157 100644 --- a/src/app/sessions/page.tsx +++ b/src/app/sessions/page.tsx @@ -1,10 +1,30 @@ +import { Suspense } from 'react'; import Link from 'next/link'; import { auth } from '@/lib/auth'; import { getSessionsByUserId } from '@/services/sessions'; import { getMotivatorSessionsByUserId } from '@/services/moving-motivators'; -import { Card, CardContent, Badge, Button } from '@/components/ui'; +import { Card, Button } from '@/components/ui'; import { WorkshopTabs } from './WorkshopTabs'; +function WorkshopTabsSkeleton() { + return ( +
+ {/* Tabs skeleton */} +
+ {[...Array(4)].map((_, i) => ( +
+ ))} +
+ {/* Cards skeleton */} +
+ {[...Array(6)].map((_, i) => ( +
+ ))} +
+
+ ); +} + export default async function SessionsPage() { const session = await auth(); @@ -88,10 +108,12 @@ export default async function SessionsPage() {
) : ( - + }> + + )} );