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:
balibabu
2024-03-20 18:20:42 +08:00
committed by GitHub
parent 6999598101
commit fce14ee187
65 changed files with 434 additions and 59 deletions

View File

@@ -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);
};