Something went wrong. Try again.
Monorepo for Tangled
Something went wrong. Try again.
Svelte
1234567891011121314151617181920212223242526272829303132333435363738394041<script lang="ts"> import { resolve } from "$app/paths"; import ArrowRight from "$icon/arrow-right"; import RepoCard from "$lib/components/repo/RepoCard.svelte"; import Button from "$lib/components/ui/Button.svelte"; import EmptyState from "$lib/components/ui/EmptyState.svelte"; import { repoKey, type RepoCardData } from "$lib/components/profile/types";
interface Props { repositories: RepoCardData[]; handle: string; href?: string; showOwner?: boolean; }
let { repositories, handle, href, showOwner = false }: Props = $props();</script>
<section class="space-y-xs"> <h2 class="px-xs typography-paragraph-regular font-medium">Pinned repositories</h2> {#if repositories.length > 0} <div class="grid gap-xs md:grid-cols-2"> {#each repositories.slice(0, 4) as repo (repoKey(repo))} <RepoCard {repo} starButton={false} {showOwner} /> {/each} </div> <div class="flex justify-end pt-xs"> <Button variant="ghost" href={resolve((href ?? `/${handle}?tab=repos`) as "/")} icon={ArrowRight} iconSide="right" > View all repositories </Button> </div> {:else} <EmptyState message="No pinned repositories." /> {/if}</section>