mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-15 17:19:11 +08:00
27 lines
738 B
TypeScript
27 lines
738 B
TypeScript
import type { FC } from 'react';
|
|
import React, { useContext } from 'react';
|
|
|
|
import Button from '../../button';
|
|
import { ModalContext } from '../context';
|
|
import type { ModalProps } from '../interface';
|
|
|
|
export interface NormalCancelBtnProps extends Pick<ModalProps, 'cancelButtonProps' | 'onCancel'> {
|
|
cancelTextLocale?:
|
|
| string
|
|
| number
|
|
| true
|
|
| React.ReactElement<any, string | React.JSXElementConstructor<any>>
|
|
| Iterable<React.ReactNode>;
|
|
}
|
|
|
|
const NormalCancelBtn: FC = () => {
|
|
const { cancelButtonProps, cancelTextLocale, onCancel } = useContext(ModalContext);
|
|
return (
|
|
<Button onClick={onCancel} {...cancelButtonProps}>
|
|
{cancelTextLocale}
|
|
</Button>
|
|
);
|
|
};
|
|
|
|
export default NormalCancelBtn;
|