2025-11-01 15:49:29 +01:00
|
|
|
<script lang="ts">
|
|
|
|
|
import { page } from '$app/state';
|
2024-04-07 06:08:34 +01:00
|
|
|
import { goto } from '$app/navigation';
|
2025-11-24 01:00:50 +01:00
|
|
|
import * as Sidebar from '@cio/ui/base/sidebar';
|
2025-11-21 12:18:04 +01:00
|
|
|
import { Skeleton } from '@cio/ui/base/skeleton';
|
|
|
|
|
import { currentOrg } from '$lib/utils/store/org';
|
2025-11-24 01:00:50 +01:00
|
|
|
import { AppHeader } from '$lib/features/ui';
|
2025-11-21 12:18:04 +01:00
|
|
|
|
2025-11-24 01:00:50 +01:00
|
|
|
import { VerifyEmailModal } from '$lib/features/onboarding/components';
|
|
|
|
|
|
|
|
|
|
import { OrgSidebar } from '$lib/features/ui/sidebar/org-sidebar/index.js';
|
2025-11-21 12:18:04 +01:00
|
|
|
import AddOrgModal from '$lib/components/Org/AddOrgModal/AddOrgModal.svelte';
|
2024-04-07 06:08:34 +01:00
|
|
|
|
2025-11-01 15:49:29 +01:00
|
|
|
let { data, children } = $props();
|
2024-04-07 06:08:34 +01:00
|
|
|
|
2025-11-01 15:49:29 +01:00
|
|
|
function redirect(siteName: string) {
|
2025-11-24 01:00:50 +01:00
|
|
|
if (!siteName) return;
|
|
|
|
|
|
2025-11-01 15:49:29 +01:00
|
|
|
const newUrl = page.url.pathname.replace('*', siteName);
|
|
|
|
|
goto(newUrl + page.url.search);
|
2024-04-07 06:08:34 +01:00
|
|
|
}
|
2025-11-01 15:49:29 +01:00
|
|
|
|
|
|
|
|
$effect(() => {
|
|
|
|
|
data.orgName === '*' && redirect($currentOrg.siteName);
|
|
|
|
|
});
|
2023-12-13 09:02:52 +03:00
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<AddOrgModal />
|
2024-04-19 05:45:48 +01:00
|
|
|
|
2024-03-22 06:30:24 +01:00
|
|
|
<VerifyEmailModal />
|
2024-04-19 05:45:48 +01:00
|
|
|
|
2025-11-24 01:00:50 +01:00
|
|
|
<Sidebar.Provider>
|
|
|
|
|
<OrgSidebar />
|
2025-11-21 12:18:04 +01:00
|
|
|
|
2025-11-24 01:00:50 +01:00
|
|
|
<Sidebar.Inset>
|
|
|
|
|
<AppHeader />
|
2025-11-21 12:18:04 +01:00
|
|
|
|
2025-12-02 09:54:38 +01:00
|
|
|
<div class="mx-auto flex w-full max-w-6xl flex-1 flex-col gap-4 overflow-y-auto px-4">
|
2025-11-24 01:00:50 +01:00
|
|
|
{#if data.orgName === '*'}
|
|
|
|
|
<div class="grid auto-rows-min gap-4 md:grid-cols-3">
|
|
|
|
|
<Skeleton class="aspect-video rounded-xl" />
|
|
|
|
|
<Skeleton class="aspect-video rounded-xl" />
|
|
|
|
|
<Skeleton class="aspect-video rounded-xl" />
|
2025-11-21 12:18:04 +01:00
|
|
|
</div>
|
2025-11-24 01:00:50 +01:00
|
|
|
<Skeleton class="h-[50vh] w-full rounded-xl" />
|
|
|
|
|
{:else}
|
|
|
|
|
{@render children?.()}
|
2025-11-21 12:18:04 +01:00
|
|
|
{/if}
|
2025-11-24 01:00:50 +01:00
|
|
|
</div>
|
|
|
|
|
</Sidebar.Inset>
|
|
|
|
|
</Sidebar.Provider>
|