import {FC, HTMLProps} from 'react';

type ActionButtonProps = Omit<HTMLProps<HTMLButtonElement>, 'type'> & {
  type?: 'button' | 'reset' | 'submit',
  block?: boolean,
}

export const ActionButton: FC<ActionButtonProps> = ({
  block = false,
  style = {},
  children,
  ...etcProps
}) => {
  return (
    <button
      {...etcProps}
      style={{
        ...style,
        display: block ? 'grid' : style?.display,
        width: block ? '100%' : style?.width,
        placeContent: 'center',
        height: '3rem',
      }}
    >
      {children}
    </button>
  )
}
