import { Button } from '@tarojs/components';

import classNames from 'classnames';

import './index.less';

interface IProps {
  className?: string;
  cancelText?: string;
  confirmText?: string;
  onClickCancel: () => void;
  onClickConfirm: () => void;
}

const PREFIX = 'picker-toolbar';

function PickerToolbar(props: IProps) {
  const { className, cancelText = '取消', confirmText = '确定', onClickCancel, onClickConfirm } = props;
  return (
    <div className={classNames(PREFIX, className)}>
      <Button className={`${PREFIX}__button-cancel`} onClick={onClickCancel}>
        {cancelText}
      </Button>
      <Button className={`${PREFIX}__button-confirm`} onClick={onClickConfirm}>
        {confirmText}
      </Button>
    </div>
  );
}

export default PickerToolbar;
