import { addToast } from '@/lib/toast' /** * Copies `text` to the clipboard and shows a success/failure toast. * Was hand-copied (identical try/writeText/toast/catch shape) in * BookingActionsModal.tsx#handleCopyCode and HostedEventActionsModal.tsx#handleShare — * this is the shared home for any future "copy X" feature. */ const useCopyToClipboard = () => { const copyToClipboard = async (text: string, messages: { successMessage: string; failureMessage: string }) => { try { await navigator.clipboard.writeText(text) addToast({ title: messages.successMessage, color: 'success' }) return true } catch { addToast({ title: messages.failureMessage, color: 'danger' }) return false } } return { copyToClipboard } } export default useCopyToClipboard