TelegramPWA/src/components/main/BotAttachModal.tsx
2022-05-30 15:40:11 +04:00

36 lines
793 B
TypeScript

import type { FC } from '../../lib/teact/teact';
import React from '../../lib/teact/teact';
import { getActions } from '../../global';
import type { ApiUser } from '../../api/types';
import useLang from '../../hooks/useLang';
import ConfirmDialog from '../ui/ConfirmDialog';
export type OwnProps = {
bot?: ApiUser;
};
const BotAttachModal: FC<OwnProps> = ({
bot,
}) => {
const { closeBotAttachRequestModal, confirmBotAttachRequest } = getActions();
const lang = useLang();
const name = bot?.firstName;
return (
<ConfirmDialog
isOpen={Boolean(bot)}
onClose={closeBotAttachRequestModal}
confirmHandler={confirmBotAttachRequest}
title={name}
textParts={lang('WebApp.AddToAttachmentText', name)}
/>
);
};
export default BotAttachModal;