Refactoring on image and component loading.

This commit is contained in:
charlesgauthereau
2025-12-22 14:23:52 +01:00
parent 3b356e33e7
commit 08f2ad0521
4 changed files with 51 additions and 19 deletions
@@ -13,9 +13,12 @@ export function OrganizationCombobox() {
const {data: activeOrganization, refetch: refetchActiveOrga} = authClient.useActiveOrganization();
const [openModal, setOpenModal] = useState(false);
if (!organizations) return null;
// if (!organizations) return null;
// const values = organizations.map(org => ({ value: org.slug, label: org.name }));
const values = organizations?.map(org => ({ value: org.slug, label: org.name })) ?? [];
const values = organizations.map(org => ({ value: org.slug, label: org.name }));
const onValueChange = async (slug: string) => {
await authClient.organization.setActive({ organizationSlug: slug });