apps/web: fix download buttons link

This commit is contained in:
vchikalkin 2023-11-28 09:49:05 +03:00
parent 0606a999ea
commit 11bcb4257d

View File

@ -1,20 +1,17 @@
import { FormContext } from './context/form-context'; import { FormContext } from './context/form-context';
import type { Props } from './types'; import type { Props } from './types';
import type * as IUS from '@/api/ius/types'; import type * as IUS from '@/api/ius/types';
import { getUrls } from '@/config/urls';
import { ArrowDownTrayIcon } from '@heroicons/react/24/solid'; import { ArrowDownTrayIcon } from '@heroicons/react/24/solid';
import Link from 'next/link'; import Link from 'next/link';
import { useContext } from 'react'; import { useContext } from 'react';
import { Heading, InputFile } from 'ui'; import { Heading, InputFile } from 'ui';
const { URL_IUS } = getUrls();
type DownloadDocumentProps = Pick<FileProps, 'document'>; type DownloadDocumentProps = Pick<FileProps, 'document'>;
function DownloadDocument({ document }: DownloadDocumentProps) { function DownloadDocument({ document }: DownloadDocumentProps) {
return document ? ( return document ? (
<Link <Link
href={URL_IUS + document?.href} href={'/api/ius' + document?.href}
target="_blank" target="_blank"
rel="noopener noreferrer" rel="noopener noreferrer"
className="text-primary-600 h-10 px-5 py-2.5 text-sm font-medium hover:underline" className="text-primary-600 h-10 px-5 py-2.5 text-sm font-medium hover:underline"