updated the formating issue with pnpm format

This commit is contained in:
jayesh
2025-08-24 10:54:32 +05:30
parent 7dc020cea9
commit c5de20978e
3 changed files with 18 additions and 22 deletions
+14 -14
View File
@@ -1,26 +1,26 @@
import type { Models } from "@appwrite.io/console";
import type { Models } from '@appwrite.io/console';
/**
* Build VCS repo URL from the template response model.
* Example (GitHub): https://github.com/appwrite/templates-for-sites
*/
export function getTemplateSourceUrl(
t: Models.TemplateSite | Models.TemplateFunction
t: Models.TemplateSite | Models.TemplateFunction
): string | null {
const owner = t.providerOwner;
const repo = t.providerRepositoryId;
const provider = t.vcsProvider; // e.g., "github"
const owner = t.providerOwner;
const repo = t.providerRepositoryId;
const provider = t.vcsProvider; // e.g., "github"
if (!owner || !repo || !provider) return null;
if (!owner || !repo || !provider) return null;
// Map provider → host (extend if needed)
const hostMap: Record<string, string> = {
github: "github.com",
gitlab: "gitlab.com",
bitbucket: "bitbucket.org",
};
// Map provider → host (extend if needed)
const hostMap: Record<string, string> = {
github: 'github.com',
gitlab: 'gitlab.com',
bitbucket: 'bitbucket.org'
};
const host = hostMap[provider.toLowerCase()] ?? provider; // fallback
const host = hostMap[provider.toLowerCase()] ?? provider; // fallback
return `https://${host}/${owner}/${repo}`;
return `https://${host}/${owner}/${repo}`;
}
@@ -62,7 +62,7 @@
</Typography.Text>
</Layout.Stack>
</Layout.Stack>
<slot name="framework-actions" />
<slot name="framework-actions" />
{/if}
{#if domain && showAfter}
@@ -352,15 +352,11 @@
alt={data.template.name}
ratio="16/9" />
</Layout.Stack>
<svelte:fragment slot="framework-actions" >
<svelte:fragment slot="framework-actions">
{@const sourceUrl = getTemplateSourceUrl(data.template)}
{#if sourceUrl}
<Button
secondary
size="s"
external
href={sourceUrl}>
<Button secondary size="s" external href={sourceUrl}>
View source
<Icon icon={IconExternalLink} slot="end" size="s" />
</Button>