Merge branch 'release/v1.30.1'

This commit is contained in:
AmirHossein Mahmoodi
2024-02-03 06:56:11 +03:30
2 changed files with 15 additions and 24 deletions

View File

@@ -1,5 +1,5 @@
NEXT_PUBLIC_API_NAME = "Loan Facilities Dashboard"
NEXT_PUBLIC_API_VERSION = "1.30.0"
NEXT_PUBLIC_API_VERSION = "1.30.1"
NEXT_PUBLIC_DEFAULT_LANGUAGE = "fa"
NEXT_PUBLIC_DEFAULT_DIRECTION = "rtl"

View File

@@ -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 (<Button
color="primary"
variant="contained"
size="small"
disabled={loading}
sx={{textTransform: "unset", alignSelf: "center", mx: .25}}
startIcon={loading ? <CircularProgress size={18} color="inherit"/> : <DescriptionIcon/>}
onClick={() => clickHandler(attachment.file)}
>
{attachment.title}
</Button>)
return (
<Button
color="primary"
variant="contained"
size="small"
component={Link}
href={attachment.file}
target="_blank"
sx={{ textTransform: "unset", alignSelf: "center", mx: 0.25 }}
>
{attachment.title}
</Button>
);
}
export default PrintHistory