import React from 'react'; import { FormattedMessage, defineMessages, useIntl } from 'react-intl'; import { Avatar, Divider, HStack, Stack, Text, Button } from 'soapbox/components/ui'; import toast from 'soapbox/toast'; import copy from 'soapbox/utils/copy'; import type { Group } from 'soapbox/schemas'; interface IConfirmationStep { group: Group | null } const messages = defineMessages({ copied: { id: 'copy.success', defaultMessage: 'Copied to clipboard!' }, }); const ConfirmationStep: React.FC = ({ group }) => { const intl = useIntl(); const handleCopyLink = () => { copy(group?.url as string, () => { toast.success(intl.formatMessage(messages.copied)); }); }; const handleShare = () => { navigator.share({ text: group?.display_name, url: group?.uri, }).catch((e) => { if (e.name !== 'AbortError') console.error(e); }); }; if (!group) { return null; } return ( {group.display_name} {('share' in navigator) && ( )} ); }; interface IInfoListNumber { number: number } const InfoListNumber: React.FC = ({ number }) => { return (
{number}
); }; interface IInfoListItem { number: number children: React.ReactNode } const InfoListItem: React.FC = ({ number, children }) => { return (
{children}
); }; export default ConfirmationStep;