From 5845b3b0736c2133bbff849829ef49229d570d97 Mon Sep 17 00:00:00 2001 From: moonayyur Date: Fri, 5 Apr 2024 16:42:58 +0200 Subject: [PATCH] feat: add info in image list --- src/components/images/ImagesPanel.tsx | 76 ++++++++++++++------------- 1 file changed, 40 insertions(+), 36 deletions(-) diff --git a/src/components/images/ImagesPanel.tsx b/src/components/images/ImagesPanel.tsx index 8d47214..46a7259 100644 --- a/src/components/images/ImagesPanel.tsx +++ b/src/components/images/ImagesPanel.tsx @@ -1,6 +1,5 @@ -import styled from '@emotion/styled'; import { useCallback, useMemo } from 'react'; -import { Button } from 'react-science/ui'; +import { Button, Table, ValueRenderers } from 'react-science/ui'; import useCurrentTab from '../../hooks/useCurrentTab'; import useData from '../../hooks/useData'; @@ -9,25 +8,6 @@ import useViewDispatch from '../../hooks/useViewDispatch'; import { CLOSE_IMAGE } from '../../state/data/DataActionTypes'; import { CLOSE_TAB, OPEN_TAB } from '../../state/view/ViewActionTypes'; -const TabTitle = styled.div` - display: flex; - align-items: center; - justify-content: center; - width: 100%; - height: 100%; -`; - -const TabItem = styled.div<{ current: boolean }>` - cursor: default; - display: flex; - align-items: center; - border-bottom: 1px solid #e0e0e0; - &:hover { - background-color: #f0f0f0; - } - background-color: ${(props) => (props.current ? '#f0f0f0' : 'white')}; -`; - export default function ImagesPanel() { const { images } = useData(); const viewDispatch = useViewDispatch(); @@ -37,7 +17,12 @@ export default function ImagesPanel() { () => Object.keys(images).map((identifier) => ({ id: identifier, - title: {images[identifier].metadata.name}, + title: images[identifier].metadata.name, + width: images[identifier].image.width, + height: images[identifier].image.height, + bitDepth: images[identifier].image.bitDepth, + channels: images[identifier].image.channels, + colorModel: images[identifier].image.colorModel, })), [images], ); @@ -68,25 +53,44 @@ export default function ImagesPanel() { return ( <> {tabsItems.length > 0 ? ( -
+ + + + + + + + + + {tabsItems.map((item) => ( - openTab(item.id)} > - {item.title} -
) : null} );