apps/web: hide download document button if no href

This commit is contained in:
vchikalkin 2023-11-30 10:49:07 +03:00
parent 498a64cdc9
commit a5eb858f4a

View File

@ -9,9 +9,9 @@ import { useContext } from 'react';
type DownloadDocumentProps = Pick<FileProps, 'document'>; type DownloadDocumentProps = Pick<FileProps, 'document'>;
function DownloadDocument({ document }: DownloadDocumentProps) { function DownloadDocument({ document }: DownloadDocumentProps) {
return document ? ( return document?.href ? (
<Link <Link
href={'/api/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"