2023-09-16 22:22:24 +01:00
|
|
|
<script lang="ts">
|
2025-12-02 09:54:38 +01:00
|
|
|
import { Button } from '@cio/ui/base/button';
|
|
|
|
|
import ArrowUpRightIcon from '@lucide/svelte/icons/arrow-up-right';
|
2023-10-30 04:52:00 +00:00
|
|
|
import { currentOrgDomain } from '$lib/utils/store/org';
|
2023-09-16 22:27:21 +01:00
|
|
|
import { isMobile } from '$lib/utils/store/useMobile';
|
2024-04-19 05:45:48 +01:00
|
|
|
import { t } from '$lib/utils/functions/translations';
|
2024-04-25 06:51:39 +01:00
|
|
|
import { user } from '$lib/utils/store/user';
|
2023-09-16 22:22:24 +01:00
|
|
|
|
2025-11-01 15:49:29 +01:00
|
|
|
interface Props {
|
|
|
|
|
className?: string;
|
|
|
|
|
isLMS?: boolean;
|
|
|
|
|
}
|
2024-04-25 06:51:39 +01:00
|
|
|
|
2025-11-01 15:49:29 +01:00
|
|
|
let { className = '', isLMS = false }: Props = $props();
|
|
|
|
|
|
|
|
|
|
let href = $derived(isLMS && $user.isLoggedIn ? `${$currentOrgDomain}/home` : $currentOrgDomain);
|
2023-09-16 22:22:24 +01:00
|
|
|
</script>
|
|
|
|
|
|
2024-04-25 06:51:39 +01:00
|
|
|
<a {href} target="_blank" class="{className} ml-2 hover:no-underline">
|
2025-12-02 09:54:38 +01:00
|
|
|
<Button variant="outline">
|
2023-09-16 22:27:21 +01:00
|
|
|
{#if !$isMobile}
|
2024-04-25 06:51:39 +01:00
|
|
|
{#if isLMS}
|
|
|
|
|
{$t('dashboard.visit_site')}
|
|
|
|
|
{:else}
|
|
|
|
|
{$t('settings.subheadings.view_site')}
|
|
|
|
|
{/if}
|
2023-09-16 22:27:21 +01:00
|
|
|
{/if}
|
2023-09-16 22:22:24 +01:00
|
|
|
<ArrowUpRightIcon />
|
2025-12-02 09:54:38 +01:00
|
|
|
</Button>
|
2023-09-16 22:22:24 +01:00
|
|
|
</a>
|