summaryrefslogtreecommitdiffstats
path: root/src/lib/components/ExtensionCard.svelte
blob: 90769e98474eb6d81f14d99a850a0fe510fd1a2c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<script lang="ts">
    interface Props {
        repo: {
            source: string;
            name: string;
            path: string;
            commit?: string;
        };
        protocol: string;
        selectedDomain: string;
    }

    let { repo, protocol, selectedDomain }: Props = $props();
</script>

<div class="card">
    <div class="card-header">
        <a href={repo.source} target="_blank" class="card-title">
            {repo.name}
        </a>
        <div class="card-meta">
            {#if repo.commit}
                Commit:{' '}
                <a
                    href={`${repo.source}/commit/${repo.commit}`}
                    target="_blank"
                    class="commit-link"
                >
                    {repo.commit.substring(0, 7)}
                </a>
            {:else}
                Commit: N/A
            {/if}
        </div>
    </div>
    <div class="card-actions">
        <a
            href={`${protocol}://add-repo?url=${selectedDomain}${repo.path}`}
            class="btn btn-primary"
        >
            Add Repo
        </a>
        <a href={`${selectedDomain}${repo.path}`} target="_blank" class="btn btn-secondary">
            JSON
        </a>
    </div>
</div>