update url

This commit is contained in:
Joseph 2025-03-26 08:56:06 +07:00
parent 9a9a94e5d4
commit c6a9fc28a3
1 changed files with 12 additions and 4 deletions

View File

@ -103,8 +103,12 @@ const Document = () => {
if (['doc'].includes(extension!)) { if (['doc'].includes(extension!)) {
return ( return (
<a <a
href={`${import.meta.env.VITE_BACKEND_URL}${uri}`} href={`${import.meta.env.VITE_BACKEND_URL}${
download="Document Download" import.meta.env.VITE_BACKEND_URL?.includes('localhost')
? ''
: 'image/'
}${uri}`}
download={row.title}
target="_self" target="_self"
> >
<IconFileTypeDoc style={{ color: '#1e62c1' }} /> <IconFileTypeDoc style={{ color: '#1e62c1' }} />
@ -115,8 +119,12 @@ const Document = () => {
if (['xls', 'xlsx'].includes(extension!)) { if (['xls', 'xlsx'].includes(extension!)) {
return ( return (
<a <a
href={`${import.meta.env.VITE_BACKEND_URL}${uri}`} href={`${import.meta.env.VITE_BACKEND_URL}${
download="Document Download" import.meta.env.VITE_BACKEND_URL?.includes('localhost')
? ''
: 'image/'
}${uri}`}
download={row.title}
target="_self" target="_self"
> >
<IconFileTypeXls style={{ color: '#0e864b' }} /> <IconFileTypeXls style={{ color: '#0e864b' }} />