bugfix: organization sidebar icon updated like organization switch feature.

This commit is contained in:
2026-05-18 14:08:07 +03:30
parent 95ed1bd4ab
commit 7dba7cc144
16 changed files with 49 additions and 21 deletions

View File

@@ -3,7 +3,9 @@
import { useMemo, useState } from 'react';
import { useAuth } from '@/lib/hooks/useAuth';
import { canCreateOrganizationFromCurrentOrg } from '@/components/shared/permissions';
import { Building2, Beaker, Mail } from 'lucide-react';
import { Building2, Mail } from 'lucide-react';
import type { Organization } from '@/types/organization';
import { organizationTypeIcon } from '@/components/shared/organizationTypeIcon';
import { Input } from '@/components/ui/shared/Input';
import { Button } from '@/components/ui/shared/Button';
@@ -26,8 +28,10 @@ export function OrganizationSelectorContent() {
const [organizationEmail, setOrganizationEmail] = useState('');
const [organizationType, setOrganizationType] = useState<'CLINIC' | 'LAB'>('CLINIC');
const getIcon = (type: string) =>
type === 'CLINIC' ? <Building2 className="h-8 w-8 icon-flat" /> : <Beaker className="h-8 w-8 icon-flat" />;
const renderOrgTypeIcon = (type: Organization['type']) => {
const Icon = organizationTypeIcon(type);
return <Icon className="h-8 w-8 icon-flat" />;
};
const handleCreateOrganization = async () => {
try {
@@ -158,7 +162,7 @@ export function OrganizationSelectorContent() {
className="surface-card p-6 transition-all text-left flex items-center gap-4 hover:border-primary/60"
>
<div className="p-3 bg-primary-soft rounded-[var(--radius-sm)] text-primary">
{getIcon(org.type)}
{renderOrgTypeIcon(org.type)}
</div>
<div className="flex-1">