diff --git a/gui/src/components/AssistantAndOrgListbox/ScopeSelect.tsx b/gui/src/components/AssistantAndOrgListbox/ScopeSelect.tsx
index 6374394fd..7cac430a8 100644
--- a/gui/src/components/AssistantAndOrgListbox/ScopeSelect.tsx
+++ b/gui/src/components/AssistantAndOrgListbox/ScopeSelect.tsx
@@ -21,6 +21,19 @@ import {
interface ScopeSelectProps {
onSelect?: () => void;
}
+
+function getOrgIcon(org: { name: string; iconUrl?: string | null }) {
+ if (org.iconUrl) {
+ return (
+
+ );
+ }
+
+ const IconComponent =
+ org.name === "Personal" ? UserCircleIcon : BuildingOfficeIcon;
+ return ;
+}
+
export function ScopeSelect({ onSelect }: ScopeSelectProps) {
const { organizations } = useAuth();
const ideMessenger = useContext(IdeMessengerContext);
@@ -39,10 +52,6 @@ export function ScopeSelect({ onSelect }: ScopeSelectProps) {
onSelect?.();
};
- const CurScopeEntityFallBackIcon = selectedOrgId
- ? BuildingOfficeIcon
- : UserCircleIcon;
-
const selectedDisplay = currentOrg ?? {
name: "Personal",
iconUrl: null,
@@ -53,15 +62,7 @@ export function ScopeSelect({ onSelect }: ScopeSelectProps) {
- {selectedDisplay?.iconUrl ? (
-

- ) : (
-
- )}
+ {getOrgIcon(selectedDisplay)}
{selectedDisplay?.name || "Select Organization"}
@@ -73,15 +74,7 @@ export function ScopeSelect({ onSelect }: ScopeSelectProps) {
{organizations.map((org) => (
- {org.iconUrl ? (
-

- ) : (
-
- )}
+ {getOrgIcon(org)}
{org.name}