your personal website on atproto - mirror
blento.app
1<script lang="ts">
2 import { cn } from '@foxui/core';
3 import type { Snippet } from 'svelte';
4
5 let {
6 onclick,
7 children,
8 href,
9 class: className
10 }: {
11 onclick?: () => void;
12 children: Snippet;
13 class?: string;
14 href?: string;
15 } = $props();
16</script>
17
18{#if onclick}
19 <button
20 class={cn('group/post-action inline-flex cursor-pointer items-center gap-2 text-sm', className)}
21 {onclick}
22 >
23 {@render children?.()}
24 </button>
25{:else if href}
26 <a
27 class={cn('group/post-action inline-flex cursor-pointer items-center gap-2 text-sm', className)}
28 {href}
29 target="_blank"
30 >
31 {@render children?.()}
32 </a>
33{:else}
34 <div class={cn('inline-flex items-center gap-2 text-sm', className)}>
35 {@render children?.()}
36 </div>
37{/if}