mirror of
https://github.com/laurent22/joplin.git
synced 2024-12-24 10:27:10 +02:00
25 lines
625 B
TypeScript
25 lines
625 B
TypeScript
import * as React from 'react';
|
|
import { _ } from '@joplin/lib/locale';
|
|
|
|
interface Props {
|
|
children: React.ReactNode;
|
|
acceptMessage: string;
|
|
onAccept: ()=> void;
|
|
onDismiss: ()=> void;
|
|
visible: boolean;
|
|
}
|
|
|
|
const BannerContent: React.FC<Props> = props => {
|
|
if (!props.visible) {
|
|
return null;
|
|
}
|
|
|
|
return <div className='warning-banner'>
|
|
{props.children}
|
|
<a onClick={props.onAccept} className='warning-banner-link' href="#">[ {props.acceptMessage} ]</a>
|
|
<a onClick={props.onDismiss} className='warning-banner-link' href="#">[ {_('Dismiss')} ]</a>
|
|
</div>;
|
|
};
|
|
|
|
export default BannerContent;
|