Skip to content

Commit

Permalink
feat: enabled download button for all documents (#2371)
Browse files Browse the repository at this point in the history
  • Loading branch information
chesterkmr authored May 16, 2024
1 parent 2779f04 commit 3a4d185
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ctw } from '@/common/utils/ctw/ctw';
import React, { ComponentProps, FunctionComponent } from 'react';
import { DownloadFileSvg } from '@/common/components/atoms/icons';
import { ctw } from '@/common/utils/ctw/ctw';
import { ComponentProps, FunctionComponent } from 'react';

export interface IDownloadFile extends ComponentProps<'div'> {
heading: string;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { Download, ExternalLinkIcon, FileText } from 'lucide-react';
import { FunctionComponent } from 'react';

import { ImageViewer } from '@/common/components/organisms/ImageViewer/ImageViewer';
import { ctw } from '@/common/utils/ctw/ctw';
import { isPdf } from '@/common/utils/is-pdf/is-pdf';
import { ImageViewer } from '@/common/components/organisms/ImageViewer/ImageViewer';
import { useDocumentsToolbarLogic } from '@/pages/Entity/components/Case/hooks/useDocumentsToolbarLogic/useDocumentsToolbarLogic';

export const DocumentsToolbar: FunctionComponent<{
Expand Down Expand Up @@ -60,9 +60,6 @@ export const DocumentsToolbar: FunctionComponent<{
<a
className={ctw(
`btn btn-circle btn-ghost btn-sm bg-base-300/70 text-[0.688rem] focus:outline-primary`,
{
'pointer-events-none opacity-50': !shouldDownload,
},
)}
download={image?.fileName}
href={fileToDownloadBase64}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import 'react-image-crop/dist/ReactCrop.css';
import { FunctionComponent } from 'react';
import 'react-image-crop/dist/ReactCrop.css';

import { ctw } from '@/common/utils/ctw/ctw';
import { IDocumentsProps } from './interfaces';
import { useDocuments } from './hooks/useDocuments/useDocuments';
import { DownloadFile } from '@/common/components/molecules/DownloadFile/DownloadFile';
import { ImageEditor } from '@/common/components/molecules/ImageEditor/ImageEditor';
import { ImageViewer } from '@/common/components/organisms/ImageViewer/ImageViewer';
import { DownloadFile } from '@/common/components/molecules/DownloadFile/DownloadFile';
import { DocumentsToolbar } from '@/pages/Entity/components/Case/Case.Documents.Toolbar';
import { ctw } from '@/common/utils/ctw/ctw';
import { keyFactory } from '@/common/utils/key-factory/key-factory';
import { DocumentsToolbar } from '@/pages/Entity/components/Case/Case.Documents.Toolbar';
import { useDocuments } from './hooks/useDocuments/useDocuments';
import { IDocumentsProps } from './interfaces';

/**
* @description To be used by {@link Case}, and be wrapped by {@link Case.Content}. Displays a single entity's documents using {@link ImageViewer}. Displays documents[0].imageUrl if no document was selected yet.
Expand Down

0 comments on commit 3a4d185

Please sign in to comment.