kafka-ui/kafka-ui-react-app/src/components/Topics/New/CustomParams/CustomParamButton.tsx
2020-04-16 17:23:05 +03:00

33 lines
642 B
TypeScript

import React from 'react';
export enum CustomParamButtonType {
plus = 'fa-plus',
minus = 'fa-minus',
}
interface Props {
onClick: (event: React.MouseEvent<HTMLButtonElement>) => void;
className: string;
type: CustomParamButtonType;
btnText?: string;
}
const CustomParamButton: React.FC<Props> = ({
onClick,
className,
type,
btnText,
}) => (
<button
type="button"
className={`button ${className} is-outlined`}
onClick={onClick}
>
{btnText && <span>{btnText}</span>}
<span className="icon">
<i className={`fas fa-lg ${type}`} />
</span>
</button>
);
export default CustomParamButton;