import { formatIDR } from '@/utils' import { HiClipboardDocumentList, HiShare } from 'react-icons/hi2' import { toast } from 'react-toastify' import { toastSuccess } from '../utils' export default function VoucherCard(props) { const { item: { share_word, additional_info_json }, } = props const sale_item = JSON.parse(additional_info_json) const voucher = sale_item?.voucher const handleShare = () => { if (navigator.canShare) { navigator.share({ title: share_word, text: share_word, }) return } navigator.clipboard.writeText(share_word) toastSuccess('copied to clipboard') return } const handleCopyToClipboard = (text) => { toastSuccess('copied to clipboard') navigator.clipboard.writeText(text) } return (