ant-design/components/transfer/operation.tsx
偏右 bdceb5f083
Review fix (#8125)
* Fix style

* Fix style

* fix lint

* Fix more styles

* Fix more styles

* update snap
2017-11-06 21:28:51 +08:00

51 lines
997 B
TypeScript

import React from 'react';
import Button from '../button';
function noop() {
}
export interface TransferOperationProps {
className?: string;
leftArrowText?: string;
rightArrowText?: string;
moveToLeft?: React.FormEventHandler<any>;
moveToRight?: React.FormEventHandler<any>;
leftActive?: boolean;
rightActive?: boolean;
}
export default (props: TransferOperationProps) => {
const {
moveToLeft = noop,
moveToRight = noop,
leftArrowText = '',
rightArrowText = '',
leftActive,
rightActive,
className,
} = 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>
);
};