@@ -4,15 +4,12 @@ import { ImageContext } from './ImageContext';
44import { HeaderTitle , MetPageGridContainer , MetParagraph , PrimaryButton } from 'components/common' ;
55import ImageUpload from '../../ImageManagement/ImageUpload' ;
66import { IconButton , Stack , TextField } from '@mui/material' ;
7- import SearchIcon from '@mui/icons-material/Search ' ;
7+ import { Search as SearchIcon , OpenInNew as OpenInNewIcon } from '@mui/icons-material' ;
88import CheckCircleOutlineIcon from '@mui/icons-material/CheckCircleOutline' ;
99import MetTable from 'components/common/Table' ;
1010import { HeadCell , PaginationOptions } from 'components/common/Table/types' ;
1111import { ImageInfo } from 'models/image' ;
12- import ContentCopyIcon from '@mui/icons-material/ContentCopy' ;
1312import { Else , If , Then } from 'react-if' ;
14- import { openNotification } from 'services/notificationService/notificationSlice' ;
15- import { useAppDispatch } from 'hooks' ;
1613import { formatDate } from 'utils/helpers/dateHelper' ;
1714
1815const ImageListing = ( ) => {
@@ -30,13 +27,6 @@ const ImageListing = () => {
3027 imageToUpload,
3128 } = useContext ( ImageContext ) ;
3229
33- const dispatch = useAppDispatch ( ) ;
34-
35- const copyToClipBoard = ( text : string ) => {
36- navigator . clipboard . writeText ( text ) ;
37- dispatch ( openNotification ( { severity : 'success' , text : 'URL copied to clipboard' } ) ) ;
38- } ;
39-
4030 const headCells : HeadCell < ImageInfo > [ ] = [
4131 {
4232 key : 'url' ,
@@ -89,8 +79,13 @@ const ImageListing = () => {
8979 < Grid container direction = { 'row' } gap = { 1 } alignItems = { 'center' } >
9080 < Grid item > { row . url } </ Grid >
9181 < Grid item >
92- < IconButton onClick = { ( ) => copyToClipBoard ( row . url ) } >
93- < ContentCopyIcon />
82+ < IconButton
83+ component = "a"
84+ href = { imageToDisplay ?. url ?? '' }
85+ target = "_blank"
86+ rel = "noopener noreferrer"
87+ >
88+ < OpenInNewIcon />
9489 </ IconButton >
9590 </ Grid >
9691 </ Grid >
@@ -161,8 +156,13 @@ const ImageListing = () => {
161156 sx = { { height : 100 } }
162157 >
163158 < MetParagraph > { imageToDisplay ?. url } </ MetParagraph >
164- < IconButton onClick = { ( ) => copyToClipBoard ( imageToDisplay ?. url ?? '' ) } >
165- < ContentCopyIcon />
159+ < IconButton
160+ component = "a"
161+ href = { imageToDisplay ?. url ?? '' }
162+ target = "_blank"
163+ rel = "noopener noreferrer"
164+ >
165+ < OpenInNewIcon />
166166 </ IconButton >
167167 </ Stack >
168168 </ Grid >
0 commit comments