feat: add loading to ChatContainer and set font family to inter and add tooltip to Form.Item and download documents on the document list page (#136)
* feat: download documents on the document list page * feat: add tooltip to Form.Item * feat: set font family to inter * feat: add loading to ChatContainer
This commit is contained in:
@@ -61,3 +61,27 @@ export const getBase64FromUploadFileList = async (fileList?: UploadFile[]) => {
|
||||
|
||||
return '';
|
||||
};
|
||||
|
||||
export const downloadFile = ({
|
||||
url,
|
||||
filename,
|
||||
target,
|
||||
}: {
|
||||
url: string;
|
||||
filename?: string;
|
||||
target?: string;
|
||||
}) => {
|
||||
const downloadElement = document.createElement('a');
|
||||
downloadElement.style.display = 'none';
|
||||
downloadElement.href = url;
|
||||
if (target) {
|
||||
downloadElement.target = '_blank';
|
||||
}
|
||||
downloadElement.rel = 'noopener noreferrer';
|
||||
if (filename) {
|
||||
downloadElement.download = filename;
|
||||
}
|
||||
document.body.appendChild(downloadElement);
|
||||
downloadElement.click();
|
||||
document.body.removeChild(downloadElement);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user