You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
712 B
30 lines
712 B
import type { ComponentProps } from "react";
|
|
import { cn } from "@/lib/utils";
|
|
|
|
export interface LoadingSkeletonProps extends ComponentProps<"div"> {
|
|
variant?: "pulse" | "shimmer" | "white";
|
|
}
|
|
|
|
export function LoadingSkeleton({
|
|
className = "",
|
|
variant = "shimmer",
|
|
...props
|
|
}: LoadingSkeletonProps) {
|
|
const baseClasses =
|
|
variant === "white"
|
|
? "shimmer-white-bg"
|
|
: variant === "pulse"
|
|
? "animate-pulse bg-slate-200/80 dark:bg-white/[0.08]"
|
|
: "shimmer-bg";
|
|
|
|
return (
|
|
<div
|
|
data-slot="loading-skeleton"
|
|
className={cn("rounded-md", baseClasses, className)}
|
|
{...props}
|
|
/>
|
|
);
|
|
}
|
|
|
|
export { LoadingSkeleton as Skeleton };
|
|
export default LoadingSkeleton;
|