TempMonitor/src/lib/components/ui/breadcrumb/breadcrumb-link.svelte
2025-05-18 13:18:46 +02:00

26 lines
456 B
Svelte

<script>
import { cn } from "$lib/utils.js";
let {
ref = $bindable(null),
class: className,
href = undefined,
child,
children,
...restProps
} = $props();
const attrs = $derived({
class: cn("hover:text-foreground transition-colors", className),
href,
...restProps,
});
</script>
{#if child}
{@render child({ props: attrs })}
{:else}
<a bind:this={ref} {...attrs}>
{@render children?.()}
</a>
{/if}