mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-04 09:28:11 +00:00
- waveform now has a loading state - audio library now has loading new items state - fix so that the "New" state works on both inference created audio items and uploaded audio items - fix so that uploaded audio items takes the file name as its title Co-authored-by: wil <wil@storyteller.ai>
39 lines
969 B
TypeScript
39 lines
969 B
TypeScript
import {
|
|
FontAwesomeIcon,
|
|
FontAwesomeIconProps,
|
|
} from "@fortawesome/react-fontawesome";
|
|
import { twMerge } from "tailwind-merge";
|
|
import { IconDefinition } from "@fortawesome/fontawesome-svg-core";
|
|
|
|
interface ButtonIconProps extends FontAwesomeIconProps {
|
|
icon: IconDefinition;
|
|
onClick: () => void;
|
|
className?: string;
|
|
hoverFill?: boolean;
|
|
disabled?: boolean;
|
|
}
|
|
|
|
export const ButtonIcon = ({
|
|
icon,
|
|
size,
|
|
onClick,
|
|
className: propsClassName,
|
|
hoverFill = false,
|
|
disabled,
|
|
...rest
|
|
}: ButtonIconProps) => {
|
|
const className = twMerge(
|
|
"flex h-8 w-8 items-center justify-center rounded-lg transition-all duration-150",
|
|
hoverFill
|
|
? "bg-ui-controls-button hover:bg-ui-controls-button/[0.75]"
|
|
: "bg-transparent hover:bg-ui-panel/[0.4]",
|
|
propsClassName,
|
|
);
|
|
|
|
return (
|
|
<button className={className} onClick={onClick} disabled={disabled}>
|
|
<FontAwesomeIcon icon={icon} size={size} {...rest}/>
|
|
</button>
|
|
);
|
|
};
|