import { Callout, ICalloutProps, mergeStyleSets, FontSizes, FontWeights, Link, Label, Text, ActionButton, useTheme, } from '@fluentui/react' import { type FC } from 'react' import { useRemoteState } from '../state' import { useCopyToClipboard } from '../hooks/use-copy-to-clipboard' const callout = mergeStyleSets({ container: { padding: '1em', }, title: { fontSize: '1.75em', fontWeight: FontWeights.semilight, margin: '0', }, secondaryTitle: { fontSize: '1em', fontWeight: FontWeights.semilight, margin: '.25em 0', }, body: { margin: '.5em 0', }, footer: { fontSize: FontSizes.smallPlus, marginTop: '.5em', textAlign: 'center', display: 'flex', justifyContent: 'space-between', }, }) interface InfoProps { showFooter?: boolean } const TextWithCopyButton: FC<{ text: string }> = ({ text }) => { const [copied, copy] = useCopyToClipboard() const theme = useTheme() return ( <> {text} copy(text)} iconProps={{ iconName: !copied ? 'Copy' : 'CheckboxComposite', style: { fontSize: FontSizes.smallPlus, color: copied ? theme.semanticColors.successIcon : 'inherit', }, }} /> ) } const InfoOverlay: FC = ({ showFooter, ...props }) => { const room = useRemoteState(state => state.room) if (!room) return null const link = `${window.location.origin}/room/${room?.id}` return (

{room?.name}

{room.created_by && (

{room?.created_by}

)}

You can invite people directly to this chat by sharing this link{' '}
{showFooter && (
Mooz by{' '} muzam1l Fork on GitHub
)}
) } export default InfoOverlay