bb-plane-fork/packages/ui/src/loader.tsx
2025-08-11 18:42:51 +05:30

30 lines
665 B
TypeScript

import React from "react";
// helpers
import { cn } from "./utils";
type Props = {
children: React.ReactNode;
className?: string;
};
const Loader = ({ children, className = "" }: Props) => (
<div className={cn("animate-pulse", className)} role="status">
{children}
</div>
);
type ItemProps = {
height?: string;
width?: string;
className?: string;
};
const Item: React.FC<ItemProps> = ({ height = "auto", width = "auto", className = "" }) => (
<div className={cn("rounded-md bg-custom-background-80", className)} style={{ height: height, width: width }} />
);
Loader.Item = Item;
Loader.displayName = "plane-ui-loader";
export { Loader };