import { Button as MuiButton, ButtonProps as MuiButtonProps } from '@mui/material';

export type ButtonProps = MuiButtonProps;

/**
 * 按钮组件
 * @param sx 自定义样式
 * @param props 其他按钮属性
 * @returns 按钮组件
 */
export function Button({ sx = [], ...props }: ButtonProps) {
  return (
    <MuiButton
      disableElevation
      disableRipple
      {...props}
      sx={[
        {
          py: 1.6,
          borderRadius: 4,
          fontSize: '1rem',
          fontWeight: 600,
          textTransform: 'none',
          transition: 'all 0.2s cubic-bezier(0.4, 0, 0.2, 1)',
          '&:hover': {
            transform: 'translateY(-1px)',
          },
          '&:active': {
            transform: 'translateY(0)',
          },
        },
        ...(Array.isArray(sx) ? sx : [sx]),
      ]}
    />
  );
}

export default Button;
