diff --git a/src/frontend/src/modals/IOModal/components/chatView/fileComponent/components/downloadButton/downloadButton.tsx b/src/frontend/src/modals/IOModal/components/chatView/fileComponent/components/downloadButton/downloadButton.tsx new file mode 100644 index 000000000..8df64561b --- /dev/null +++ b/src/frontend/src/modals/IOModal/components/chatView/fileComponent/components/downloadButton/downloadButton.tsx @@ -0,0 +1,25 @@ +import ForwardedIconComponent from "../../../../../../../components/genericIconComponent"; + +export default function DownloadButton({ + isHovered, + handleDownload, +}: { + isHovered: boolean; + handleDownload: () => void; +}): JSX.Element | undefined { + if (isHovered) { + return ( +
+ +
+ ); + } + return undefined; +} diff --git a/src/frontend/src/modals/IOModal/components/chatView/fileComponent/index.tsx b/src/frontend/src/modals/IOModal/components/chatView/fileComponent/index.tsx index f15c6b63e..a99006242 100644 --- a/src/frontend/src/modals/IOModal/components/chatView/fileComponent/index.tsx +++ b/src/frontend/src/modals/IOModal/components/chatView/fileComponent/index.tsx @@ -7,6 +7,7 @@ import { fileCardPropsType } from "../../../../../types/components"; import useFlowsManagerStore from "../../../../../stores/flowsManagerStore"; import { BACKEND_URL, BASE_URL_API } from "../../../../../constants/constants"; import formatFileName from "../filePreviewChat/utils/format-file-name"; +import DownloadButton from "./components/downloadButton/downloadButton"; const imgTypes = new Set(["png", "jpg"]); @@ -62,21 +63,10 @@ export default function FileCard({ alt="generated image" className="m-0 h-auto w-auto rounded-lg border border-border p-0 transition-all" /> - {isHovered && ( -
- -
- )} + ); @@ -98,18 +88,7 @@ export default function FileCard({ File - {isHovered && ( -
- -
- )} + ); }