From 2aeb75f4cfa9a45e738347949cce4833fb3c29b6 Mon Sep 17 00:00:00 2001 From: AmirHossein Mahmoodi Date: Sat, 3 Feb 2024 06:53:53 +0330 Subject: [PATCH] fixed bug link loan history --- .../Form/HistoryForm/PrintHistory.jsx | 37 +++++++------------ 1 file changed, 14 insertions(+), 23 deletions(-) diff --git a/src/components/dashboard/loan-history/Form/HistoryForm/PrintHistory.jsx b/src/components/dashboard/loan-history/Form/HistoryForm/PrintHistory.jsx index 438bff5..9028919 100644 --- a/src/components/dashboard/loan-history/Form/HistoryForm/PrintHistory.jsx +++ b/src/components/dashboard/loan-history/Form/HistoryForm/PrintHistory.jsx @@ -3,33 +3,24 @@ import {useTranslations} from "next-intl"; import {useState} from "react"; import useRequest from "@/lib/app/hooks/useRequest"; import DescriptionIcon from '@mui/icons-material/Description'; +import Link from "next/link"; const PrintHistory = ({attachment}) => { const t = useTranslations(); - const [loading, setLoading] = useState(false) - const requestServer = useRequest({auth: true, pending: false, success: {notification: {show: false}}}) - const clickHandler = (attachment) => { - const anchor = document.createElement('a'); - anchor.href = attachment; - anchor.setAttribute('download', ''); - document.body.appendChild(anchor); - anchor.click(); - document.body.removeChild(anchor); - } - - - return () + return ( + + ); } export default PrintHistory \ No newline at end of file