import { FC, useState } from 'react'; import { LocalizeText } from '../../../api'; import { Button, Column, Grid, NitroCardContentView, NitroCardHeaderView, NitroCardView } from '../../../common'; import { useDoorbellActions } from '../hooks/useDoorbellActions'; import { useDoorbellState } from '../hooks/useDoorbellState'; export const DoorbellWidgetView: FC = () => { const users = useDoorbellState(); const { answer } = useDoorbellActions(); const [ dismissed, setDismissed ] = useState(false); const isVisible = !dismissed && users.length > 0; if(!isVisible) return null; return ( setDismissed(true) } />
{ LocalizeText('generic.username') }
{ users.map(userName => (
{ userName }
)) }
); };