'use client';
import { useEffect } from 'react';
import { useAuth } from '@/lib/hooks/useAuth';
import { Building2, Beaker } from 'lucide-react';
export default function SelectOrganizationPage() {
const { organizations, selectOrganization, isLoading } = useAuth();
// ✅ Auto-redirect if only one organization
useEffect(() => {
if (!isLoading && organizations.length === 1) {
selectOrganization(organizations[0].id);
}
}, [organizations, isLoading]);
const getIcon = (type: string) => {
return type === 'CLINIC'
?
Loading organizations...
No organizations found.
You have access to multiple organizations. Select one to continue.