28 lines
603 B
Svelte
28 lines
603 B
Svelte
|
|
<!--
|
||
|
|
Component: Skeleton
|
||
|
|
Generic loading placeholder with shimmer animation.
|
||
|
|
-->
|
||
|
|
<script lang="ts">
|
||
|
|
import { cn } from '$shared/shadcn/utils/shadcn-utils';
|
||
|
|
import type { HTMLAttributes } from 'svelte/elements';
|
||
|
|
|
||
|
|
interface Props extends HTMLAttributes<HTMLDivElement> {
|
||
|
|
/**
|
||
|
|
* Whether to show the shimmer animation
|
||
|
|
*/
|
||
|
|
animate?: boolean;
|
||
|
|
}
|
||
|
|
|
||
|
|
let { class: className, animate = true, ...rest }: Props = $props();
|
||
|
|
</script>
|
||
|
|
|
||
|
|
<div
|
||
|
|
class={cn(
|
||
|
|
'rounded-md bg-gray-100/50 backdrop-blur-sm',
|
||
|
|
animate && 'animate-pulse',
|
||
|
|
className,
|
||
|
|
)}
|
||
|
|
{...rest}
|
||
|
|
>
|
||
|
|
</div>
|