mirror of
https://github.com/zhom/donutbrowser.git
synced 2026-04-24 04:46:22 +02:00
19 lines
486 B
TypeScript
19 lines
486 B
TypeScript
import { LuLoaderCircle } from "react-icons/lu";
|
|
import { type ButtonProps, Button as UIButton } from "./ui/button";
|
|
|
|
type Props = ButtonProps & {
|
|
isLoading: boolean;
|
|
"aria-label"?: string;
|
|
};
|
|
export const LoadingButton = ({ isLoading, ...props }: Props) => {
|
|
return (
|
|
<UIButton className="grid place-items-center" {...props}>
|
|
{isLoading ? (
|
|
<LuLoaderCircle className="h-4 w-4 animate-spin" />
|
|
) : (
|
|
props.children
|
|
)}
|
|
</UIButton>
|
|
);
|
|
};
|