import * as React from 'react'; import { Alert, Box, Button, Divider, Input, Modal, ModalDialog, Stack, Typography } from '@mui/joy'; import { ApiExportResponse } from '../../pages/api/export'; import { Link } from '@/components/util/Link'; /** * Displays the result of a conversation export as a modal dialog. * This is to give the user the chance to write down the deletion key, mainly. */ export function ExportOutcomeDialog(props: { onClose: () => void, response: ApiExportResponse, open: boolean }) { if (!props.response || props.response.type !== 'success') return null; const { url, deletionKey, expires } = props.response; return ( Your conversation is live! This is your link (opens in a new window) {url} Deletion key IMPORTANT - Keep this key safe! You will need it if you decide to delete the paste, and it will not appear again once you close this dialog. {expires?.length >= 10 && ( The conversation will be deleted on {new Date(expires).toLocaleString()}. )} ); }