new-personal-site/components/lib/layout/LoadingRectangleBlock.tsx

29 lines
720 B
TypeScript
Raw Normal View History

2024-12-09 15:36:17 +00:00
import { DetailedHTMLProps, HTMLAttributes } from "react";
import { twMerge } from "tailwind-merge";
export type LoadingRectangleBlockProps = DetailedHTMLProps<
HTMLAttributes<HTMLDivElement>,
HTMLDivElement
>;
/**
* # A loading Rectangle block
* @className twui-loading-rectangle-block
*/
export default function LoadingRectangleBlock({
...props
}: LoadingRectangleBlockProps) {
return (
<div
{...props}
className={twMerge(
"flex items-center w-full h-10 animate-pulse bg-slate-200 rounded",
"twui-loading-rectangle-block",
props.className
)}
>
{props.children}
</div>
);
}