@@ -21,6 +21,7 @@ import CollapsibleSection from '../containers/CollapsibleSection';
2121import ScrollIndicatedDialogContent from '../containers/ScrollIndicatedDialogContent' ;
2222import ManifestInfo from '../containers/ManifestInfo' ;
2323import WorkspaceContext from '../contexts/WorkspaceContext' ;
24+ import { IIIFResourceLabel } from './IIIFResourceLabel' ;
2425
2526const StyledScrollIndicatedDialogContent = styled ( ScrollIndicatedDialogContent ) ( ( ) => ( {
2627 padding : ( theme ) => theme . spacing ( 1 ) ,
@@ -38,15 +39,6 @@ const StyledCollectionFilter = styled('div')(() => ({
3839 paddingTop : 0 ,
3940} ) ) ;
4041
41- /** */
42- function getUseableLabel ( resource , index ) {
43- return ( resource
44- && resource . getLabel
45- && resource . getLabel ( ) . length > 0 )
46- ? resource . getLabel ( ) . getValue ( )
47- : String ( index + 1 ) ;
48- }
49-
5042/** */
5143const Placeholder = ( { onClose, container } ) => (
5244 < Dialog
@@ -149,7 +141,7 @@ export function CollectionDialog({
149141 { t ( isMultipart ? 'multipartCollection' : 'collection' ) }
150142 </ Typography >
151143 < Typography component = "div" variant = "h3" >
152- { getUseableLabel ( manifest ) }
144+ < IIIFResourceLabel resource = { manifest } />
153145 </ Typography >
154146 </ DialogTitle >
155147 < StyledScrollIndicatedDialogContent >
@@ -158,7 +150,7 @@ export function CollectionDialog({
158150 startIcon = { < ArrowBackIcon /> }
159151 onClick = { ( ) => goToPreviousCollection ( ) }
160152 >
161- { getUseableLabel ( collection ) }
153+ < IIIFResourceLabel resource = { collection } />
162154 </ Button >
163155 ) }
164156
@@ -204,7 +196,7 @@ export function CollectionDialog({
204196 onClick = { ( ) => { selectCollection ( c ) ; } }
205197 variant = "multiline"
206198 >
207- { getUseableLabel ( c ) }
199+ < IIIFResourceLabel resource = { c } />
208200 </ MenuItem >
209201 ) )
210202 }
@@ -219,7 +211,7 @@ export function CollectionDialog({
219211 onClick = { ( ) => { selectManifest ( m ) ; } }
220212 variant = "multiline"
221213 >
222- { getUseableLabel ( m ) }
214+ < IIIFResourceLabel resource = { m } />
223215 </ MenuItem >
224216 ) )
225217 }
0 commit comments