@@ -13,7 +13,7 @@ import {
1313 GetVideosByVidObservationsApiResponse ,
1414} from 'src/features/api' ;
1515import { ReactComponent as TagIcon } from 'src/assets/icons/tag-icon.svg' ;
16- import { ReactComponent as CopyIcon } from 'src/assets/icons/link-fill .svg' ;
16+ import { ReactComponent as ShareIcon } from 'src/assets/icons/share-stroke .svg' ;
1717import { useTranslation } from 'react-i18next' ;
1818import { useParams } from 'react-router-dom' ;
1919import { useCallback , useEffect , useState } from 'react' ;
@@ -22,6 +22,7 @@ import { useLocalizeRoute } from 'src/hooks/useLocalizedRoute';
2222import { styled } from 'styled-components' ;
2323import { getColorWithAlpha } from 'src/common/utils' ;
2424import { formatDuration } from 'src/pages/Videos/utils/formatDuration' ;
25+ import { Divider } from 'src/common/components/divider' ;
2526import { ObservationForm } from './ObservationForm' ;
2627import { useVideoContext } from '../context/VideoContext' ;
2728
@@ -36,9 +37,11 @@ const Circle = styled.div<{
3637 align-items: center;
3738 border-radius: 50%;
3839` ;
39- const StyledTitle = styled ( Title ) `
40+
41+ const Container = styled . div `
4042 display: flex;
4143 align-items: center;
44+ width: 100%;
4245` ;
4346
4447const Observation = ( {
@@ -144,95 +147,84 @@ const Observation = ({
144147 } , [ ] ) ;
145148
146149 return (
147- < Accordion
148- level = { 3 }
149- style = { { padding : 0 , marginBottom : appTheme . space . md } }
150- key = { `observation_accordion_${ observation . id } _${ isOpen } ` }
151- defaultExpandedSections = { isOpen ? [ 0 , 1 ] : [ ] }
152- onChange = { handleAccordionChange }
153- id = { `video-observation-accordion-${ observation . id } ` }
154- >
155- < Accordion . Section >
156- < Accordion . Header >
157- < Accordion . Label style = { { padding : 0 } } >
158- < div
159- style = { {
160- display : 'flex' ,
161- flexDirection : 'row' ,
162- alignItems : 'center' ,
163- } }
164- >
165- < Circle
166- color = {
167- observation . tags . find (
168- ( tag ) => tag . group . name . toLowerCase ( ) === 'severity'
169- ) ?. tag . style || appTheme . palette . grey [ 600 ]
170- }
171- style = { {
172- backgroundColor : getColorWithAlpha (
150+ < >
151+ < Divider style = { { margin : `${ appTheme . space . sm } auto` } } />
152+ < Accordion
153+ level = { 3 }
154+ style = { { padding : `${ appTheme . space . md } 0` } }
155+ key = { `observation_accordion_${ observation . id } _${ isOpen } ` }
156+ defaultExpandedSections = { isOpen ? [ 0 , 1 ] : [ ] }
157+ onChange = { handleAccordionChange }
158+ id = { `video-observation-accordion-${ observation . id } ` }
159+ >
160+ < Accordion . Section >
161+ < Accordion . Header >
162+ < Accordion . Label style = { { padding : 0 } } >
163+ < Container >
164+ < Circle
165+ color = {
173166 observation . tags . find (
174167 ( tag ) => tag . group . name . toLowerCase ( ) === 'severity'
175- ) ?. tag . style || appTheme . palette . grey [ 600 ] ,
176- 0.1
177- ) ,
178- } }
179- >
180- < TagIcon
168+ ) ?. tag . style || appTheme . palette . grey [ 600 ]
169+ }
181170 style = { {
182- color :
171+ backgroundColor : getColorWithAlpha (
183172 observation . tags . find (
184173 ( tag ) => tag . group . name . toLowerCase ( ) === 'severity'
185174 ) ?. tag . style || appTheme . palette . grey [ 600 ] ,
175+ 0.1
176+ ) ,
186177 } }
187- />
188- </ Circle >
189- < div >
190- < StyledTitle >
178+ >
179+ < TagIcon
180+ style = { {
181+ color :
182+ observation . tags . find (
183+ ( tag ) => tag . group . name . toLowerCase ( ) === 'severity'
184+ ) ?. tag . style || appTheme . palette . grey [ 600 ] ,
185+ } }
186+ />
187+ </ Circle >
188+ < Title style = { { flexGrow : 1 } } >
191189 < LG isBold > { title } </ LG >
192- </ StyledTitle >
193- </ div >
194- < Tooltip
195- content = { t ( '__VIDEO_PAGE_OBSERVATION_LINK_TOOLTIP' ) }
196- size = "large"
197- type = "light"
198- placement = "bottom-start"
199- hasArrow = { false }
200- >
201- < IconButton
202- size = "small"
203- style = { {
204- display : 'flex' ,
205- alignItems : 'center' ,
206- marginLeft : appTheme . space . sm ,
207- } }
208- onClick = { ( event ) =>
209- copyLink ( `observation-${ observation . id } ` , event )
210- }
190+ < SM
191+ style = { {
192+ color : appTheme . palette . grey [ 600 ] ,
193+ marginTop : appTheme . space . xs ,
194+ } }
195+ >
196+ { formatDuration ( start ) } - { formatDuration ( end ) }
197+ </ SM >
198+ </ Title >
199+ < Tooltip
200+ content = { t ( '__VIDEO_PAGE_OBSERVATION_LINK_TOOLTIP' ) }
201+ size = "large"
202+ type = "light"
203+ placement = "bottom-start"
204+ hasArrow = { false }
211205 >
212- < CopyIcon style = { { width : 14 , height : 14 } } />
213- </ IconButton >
214- </ Tooltip >
215- </ div >
216- < SM
217- style = { {
218- color : appTheme . palette . grey [ 600 ] ,
219- marginTop : appTheme . space . xs ,
220- marginLeft : appTheme . space . lg ,
221- } }
222- >
223- { formatDuration ( start ) } - { formatDuration ( end ) }
224- </ SM >
225- </ Accordion . Label >
226- </ Accordion . Header >
227- < Accordion . Panel style = { { padding : 0 } } >
228- < ObservationForm
229- observation = { observation }
230- onSubmit = { handleSubmit }
231- paragraphs = { transcript ?. paragraphs }
232- />
233- </ Accordion . Panel >
234- </ Accordion . Section >
235- </ Accordion >
206+ < IconButton
207+ size = "small"
208+ onClick = { ( event ) =>
209+ copyLink ( `observation-${ observation . id } ` , event )
210+ }
211+ >
212+ < ShareIcon />
213+ </ IconButton >
214+ </ Tooltip >
215+ </ Container >
216+ </ Accordion . Label >
217+ </ Accordion . Header >
218+ < Accordion . Panel style = { { padding : 0 } } >
219+ < ObservationForm
220+ observation = { observation }
221+ onSubmit = { handleSubmit }
222+ paragraphs = { transcript ?. paragraphs }
223+ />
224+ </ Accordion . Panel >
225+ </ Accordion . Section >
226+ </ Accordion >
227+ </ >
236228 ) ;
237229} ;
238230
0 commit comments