You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-11-26 22:41:17 +02:00
28 lines
608 B
TypeScript
28 lines
608 B
TypeScript
import * as React from 'react';
|
|
import { _ } from '@joplin/lib/locale';
|
|
import { useCallback, useState } from 'react';
|
|
|
|
interface Props {
|
|
message: string;
|
|
onCancel: ()=> void;
|
|
}
|
|
|
|
const TrashNotificationMessage: React.FC<Props> = props => {
|
|
const [cancelling, setCancelling] = useState(false);
|
|
const onCancel = useCallback(() => {
|
|
setCancelling(true);
|
|
props.onCancel();
|
|
}, [props.onCancel]);
|
|
|
|
return <>
|
|
{props.message}
|
|
{' '}
|
|
<button
|
|
className="link-button"
|
|
onClick={onCancel}
|
|
>{cancelling ? _('Cancelling...') : _('Cancel')}</button>
|
|
</>;
|
|
};
|
|
|
|
export default TrashNotificationMessage;
|