Fix what the AI broke

This commit is contained in:
2026-02-07 13:17:04 -05:00
parent dd052b0557
commit 456feed128
2 changed files with 21 additions and 41 deletions

View File

@@ -1,44 +1,31 @@
import type { ButtonProps } from "$/types/ButtonTypes";
import clsx from "clsx";
import * as React from "react";
import { forwardRef } from "react";
const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
(
{
className,
rounding = "lg",
shape = "rectangle",
size = "md",
variant = "standard",
disabled,
ariaLabel,
ariaDescribedBy,
ariaControls,
role,
tabIndex,
children,
onClick,
...buttonProps
},
ref
) => {
const Button = forwardRef<HTMLButtonElement, ButtonProps>((
{
className,
type="button",
rounding = "lg",
shape = "rectangle",
size = "md",
variant = "standard",
disabled,
...buttonProps
}, ref ) => {
return (
<button
ref={ref}
data-testid="mattrixwv-button"
ref={ref}
type={type}
{...buttonProps}
disabled={disabled}
aria-label={ariaLabel}
aria-describedby={ariaDescribedBy}
aria-controls={ariaControls}
role={role}
tabIndex={tabIndex}
className={clsx(
className,
//Focus
"focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2",
//Rounding
{
"rounded-sm": rounding === "sm",
@@ -67,12 +54,11 @@ const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
},
//Disabled
{
"cursor-pointer": !disabled
"cursor-pointer": !disabled,
"cursor-not-allowed opacity-75": disabled
}
)}
>
{children}
</button>
/>
);
}
);