feat: add View source button to template detail page

This commit is contained in:
jayesh
2025-08-20 20:13:39 +05:30
parent bc936e0e16
commit cab8754b48
2 changed files with 18 additions and 0 deletions
@@ -62,6 +62,9 @@
</Typography.Text>
</Layout.Stack>
</Layout.Stack>
<Layout.Stack gap="s">
<slot name="framework-actions" />
</Layout.Stack>
{/if}
{#if domain && showAfter}
@@ -37,6 +37,7 @@
import { connectGitHub } from '$lib/stores/git';
import { getFrameworkIcon } from '$lib/stores/sites';
import { regionalConsoleVariables } from '$routes/(console)/project-[region]-[project]/store';
import { getTemplateSourceUrl } from '$lib/helpers/templateSource';
export let data;
@@ -351,6 +352,20 @@
alt={data.template.name}
ratio="16/9" />
</Layout.Stack>
<svelte:fragment slot="framework-actions" >
{@const sourceUrl = getTemplateSourceUrl(data.template)}
{#if sourceUrl}
<Button
secondary
size="s"
external
href={sourceUrl}>
View source
<Icon icon={IconExternalLink} slot="end" size="s" />
</Button>
{/if}
</svelte:fragment>
</Aside>
</svelte:fragment>