import type { LinkSafetyModalProps } from "streamdown" import * as React from "react" import { Button } from "../ui/button" import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, } from "../ui/dialog" export function ExternalLinkDialog({ isOpen, onClose, onConfirm, url }: LinkSafetyModalProps) { const [copied, setCopied] = React.useState(false) const close = () => { setCopied(false) onClose() } const copyUrl = async () => { await navigator.clipboard.writeText(url) setCopied(true) } const openUrl = () => { onConfirm() close() } return ( { if (!open) close() }}> Open external link? You’re about to visit an external website.
{url}
) }