@@ -8,6 +8,8 @@ export interface AppDetailViewProps extends Omit<React.HTMLAttributes<HTMLDivEle
88 label : string ;
99 content : React . ReactNode ;
1010 isEmpty ?: boolean ;
11+ center ?: boolean ;
12+ noWrapper ?: boolean ;
1113 } [ ] ;
1214 aCol ?: number | true | Record < 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl' , number | true > ;
1315 aGutter ?: number | [ number ?, number ?] ;
@@ -77,12 +79,19 @@ export function AppDetailView(props: AppDetailViewProps): JSX.Element | null {
7779 [ `gy-${ gutterY } ` ] : gutterY ,
7880 } ) }
7981 >
80- { aList . map ( ( { label, content, isEmpty : _isEmpty } ) => {
82+ { aList . map ( ( { label, content : _content , isEmpty : _isEmpty , center , noWrapper } ) => {
8183 const isEmpty = isUndefined ( _isEmpty )
82- ? ( isString ( content ) && content . length === 0 ) || isUndefined ( content ) || isNull ( content )
84+ ? ( isString ( _content ) && _content . length === 0 ) || isUndefined ( _content ) || isNull ( _content )
8385 : _isEmpty ;
86+ const content = isEmpty ? aEmpty : _content ;
87+
8488 return (
85- < div key = { label } className = { getClassName ( 'app-detail-view__item' , col ) } >
89+ < div
90+ key = { label }
91+ className = { getClassName ( 'app-detail-view__item' , col , {
92+ 'app-detail-view__item--center' : center ,
93+ } ) }
94+ >
8695 < div
8796 className = "app-detail-view__item-label"
8897 style = { {
@@ -92,7 +101,7 @@ export function AppDetailView(props: AppDetailViewProps): JSX.Element | null {
92101 >
93102 { label }
94103 </ div >
95- < div className = "app-detail-view__item-content" > { isEmpty ? aEmpty : content } </ div >
104+ { noWrapper ? content : < div className = "app-detail-view__item-content" > { content } </ div > }
96105 </ div >
97106 ) ;
98107 } ) }
0 commit comments