From 7ada2bea9ba87aca0992506f2ac595d30a89496e Mon Sep 17 00:00:00 2001 From: Karl Ludwig Weise Date: Mon, 8 Sep 2025 09:30:57 +0200 Subject: [PATCH] Improve tenant selection --- project.inlang/messages/de.json | 4 +-- project.inlang/messages/en.json | 4 +-- .../components/tenant-switcher.svelte | 25 +++++++++++++------ .../(pages)/dashboard/tenants/+page.svelte | 8 +++--- 4 files changed, 26 insertions(+), 15 deletions(-) diff --git a/project.inlang/messages/de.json b/project.inlang/messages/de.json index b7c5aab..3a6f1f3 100644 --- a/project.inlang/messages/de.json +++ b/project.inlang/messages/de.json @@ -174,7 +174,7 @@ }, "actions": "Aktionen", "edit": "Editieren", - "configure": "Konfigurieren", "pause": "Pausieren", - "delete": "Löschen" + "delete": "Löschen", + "select": "Auswählen" } diff --git a/project.inlang/messages/en.json b/project.inlang/messages/en.json index fdbc25e..8c3efb1 100644 --- a/project.inlang/messages/en.json +++ b/project.inlang/messages/en.json @@ -182,7 +182,7 @@ }, "actions": "Actions", "edit": "Edit", - "configure": "Configure", "pause": "Pause", - "delete": "Delete" + "delete": "Delete", + "select": "Select" } diff --git a/src/lib/components/layouts/sidebar-layout/components/tenant-switcher.svelte b/src/lib/components/layouts/sidebar-layout/components/tenant-switcher.svelte index f6135cd..d051a60 100644 --- a/src/lib/components/layouts/sidebar-layout/components/tenant-switcher.svelte +++ b/src/lib/components/layouts/sidebar-layout/components/tenant-switcher.svelte @@ -11,8 +11,9 @@ import ChevronsUpDownIcon from "@lucide/svelte/icons/chevrons-up-down"; import EllipsisIcon from "@lucide/svelte/icons/ellipsis"; import UnplugIcon from "@lucide/svelte/icons/unplug"; - import UnknownTenantIcon from "@lucide/svelte/icons/ticket-x"; + import UnknownTenantIcon from "@lucide/svelte/icons/shield-question-mark"; import Loader from "@lucide/svelte/icons/loader-2"; + import { cn } from "$lib/utils"; const sidebar = useSidebar(); @@ -27,11 +28,17 @@ {#if $tenants.isLoading} - -
- -
-
+
+ +
+ +
+
+
{:else} @@ -45,7 +52,11 @@
- + {#if activeTenant} + + {:else} + + {/if}
{#if activeTenant} diff --git a/src/routes/(pages)/dashboard/tenants/+page.svelte b/src/routes/(pages)/dashboard/tenants/+page.svelte index 201661e..247300f 100644 --- a/src/routes/(pages)/dashboard/tenants/+page.svelte +++ b/src/routes/(pages)/dashboard/tenants/+page.svelte @@ -3,14 +3,14 @@ import { m } from "$i18n/messages"; import { MaxPageWidth } from "$lib/components/layouts/max-page-width"; import { SidebarLayout } from "$lib/components/layouts/sidebar-layout"; - import EmptyState from "$lib/components/templates/empty-state/empty-state.svelte"; + import EmptyState from "$lib/components/templates/empty-state/center-state.svelte"; import { List, ListItem } from "$lib/components/templates/list"; import { LoadingList } from "$lib/components/templates/loading"; import { Button } from "$lib/components/ui/button"; import { ResponsiveDialog, closeDialog, openDialog } from "$lib/components/ui/responsive-dialog"; import { ROUTES } from "$lib/const/routes"; import { type TTenant } from "$lib/types/tenant"; - import ConfigureIcon from "@lucide/svelte/icons/cog"; + import SelectIcon from "@lucide/svelte/icons/plug-zap"; import EditIcon from "@lucide/svelte/icons/pencil"; import PlusIcon from "@lucide/svelte/icons/plus"; import UnknownTenantIcon from "@lucide/svelte/icons/ticket-x"; @@ -79,8 +79,8 @@ }, { type: "action", - icon: ConfigureIcon, - label: m["configure"](), + icon: SelectIcon, + label: m["select"](), onClick: () => tenantsStore.setCurrentTenant(tenant.id, true), }, {