({ account, groups, contacts, domain }: NewMessageButtonProps)
| 20 | } |
| 21 | |
| 22 | export function NewMessageButton({ account, groups, contacts, domain }: NewMessageButtonProps) { |
| 23 | const [isDialogOpen, setIsDialogOpen] = useState(false) |
| 24 | const checkDomain = useDomainCheck(domain) |
| 25 | |
| 26 | const handleNewMessage = () => { |
| 27 | checkDomain(() => setIsDialogOpen(true)) |
| 28 | } |
| 29 | |
| 30 | return ( |
| 31 | <> |
| 32 | <Button variant="outline" onClick={handleNewMessage}> |
| 33 | Get Started |
| 34 | </Button> |
| 35 | <Dialog open={isDialogOpen} onOpenChange={setIsDialogOpen}> |
| 36 | <DialogContent className="sm:max-w-[625px]"> |
| 37 | <DialogHeader> |
| 38 | <DialogTitle>New Message</DialogTitle> |
| 39 | <DialogDescription> |
| 40 | Compose and send a new message |
| 41 | </DialogDescription> |
| 42 | </DialogHeader> |
| 43 | <MessageForm |
| 44 | selectedContactEmail="" |
| 45 | groups={groups} |
| 46 | contacts={contacts} |
| 47 | account={account} |
| 48 | onClose={() => setIsDialogOpen(false)} |
| 49 | domain={domain} |
| 50 | /> |
| 51 | </DialogContent> |
| 52 | </Dialog> |
| 53 | </> |
| 54 | ) |
| 55 | } |
nothing calls this directly
no test coverage detected