Spaces:
Running
Running
File size: 790 Bytes
d5c6d34 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
import { type ReactNode } from "react";
import { THEME } from "../constants";
interface ButtonProps {
children: ReactNode;
onClick: (e: React.MouseEvent) => void;
className?: string;
disabled?: boolean;
"aria-label"?: string;
}
export default function Button({
children,
onClick,
className = "",
disabled = false,
...ariaProps
}: ButtonProps) {
return (
<button
className={`px-4 py-2 rounded-xl border-none cursor-pointer outline-none ${
disabled ? "opacity-50 cursor-not-allowed" : ""
} ${className}`}
style={{ backgroundColor: THEME.mistralOrange }}
onClick={disabled ? undefined : onClick}
disabled={disabled}
{...ariaProps}
>
<div className="font-medium text-white">{children}</div>
</button>
);
}
|