You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
import * as React from 'react';
|
|
|
|
import Button from '../button';
|
|
|
|
|
|
|
|
export interface TransferOperationProps {
|
|
|
|
className?: string;
|
|
|
|
leftArrowText?: string;
|
|
|
|
rightArrowText?: string;
|
|
|
|
moveToLeft?: React.FormEventHandler<HTMLButtonElement>;
|
|
|
|
moveToRight?: React.FormEventHandler<HTMLButtonElement>;
|
|
|
|
leftActive?: boolean;
|
|
|
|
rightActive?: boolean;
|
|
|
|
}
|
|
|
|
|
|
|
|
export default class Operation extends React.Component<TransferOperationProps, any> {
|
|
|
|
render() {
|
|
|
|
const {
|
|
|
|
moveToLeft,
|
|
|
|
moveToRight,
|
|
|
|
leftArrowText = '',
|
|
|
|
rightArrowText = '',
|
|
|
|
leftActive,
|
|
|
|
rightActive,
|
|
|
|
className,
|
|
|
|
} = this.props;
|
|
|
|
return (
|
|
|
|
<div className={className}>
|
|
|
|
<Button
|
|
|
|
type="primary"
|
|
|
|
size="small"
|
|
|
|
disabled={!leftActive}
|
|
|
|
onClick={moveToLeft}
|
|
|
|
icon="left"
|
|
|
|
>
|
|
|
|
{leftArrowText}
|
|
|
|
</Button>
|
|
|
|
<Button
|
|
|
|
type="primary"
|
|
|
|
size="small"
|
|
|
|
disabled={!rightActive}
|
|
|
|
onClick={moveToRight}
|
|
|
|
icon="right"
|
|
|
|
>
|
|
|
|
{rightArrowText}
|
|
|
|
</Button>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|