@@ -59,7 +59,7 @@ export const Deck: FunctionComponent<DeckProps> = ({
5959 getPageLabel = ( current , total ) => `Page ${ current } of ${ total } ` ,
6060 ...props
6161} : DeckProps ) => {
62- const [ currentPageIndex , setCurrentPageIndex ] = useState ( initialPage ) ;
62+ const [ currentPageIndex , setCurrentPageIndex ] = useState ( initialPage ) ;
6363
6464 const handlePageChange = ( newIndex : number ) => {
6565 if ( newIndex >= 0 && newIndex < pages . length ) {
@@ -143,35 +143,35 @@ export const Deck: FunctionComponent<DeckProps> = ({
143143 { currentPage ?. buttons && currentPage . buttons . length > 0 && (
144144 < FlexItem >
145145 < ActionList data-ouia-component-id = { `${ ouiaId } -buttons` } >
146- < ActionListGroup >
147- { currentPage . buttons . map ( ( buttonConfig , index ) => {
148- const { navigation, onClick, ...buttonProps } = buttonConfig ;
149-
150- // Auto-wire navigation if specified
151- const handleClick = ( event : React . MouseEvent < HTMLButtonElement > ) => {
152- // Call user's custom onClick first if provided
153- onClick ?.( event ) ;
154-
155- // Then handle navigation
156- if ( navigation === 'next' ) {
157- handlePageChange ( currentPageIndex + 1 ) ;
158- } else if ( navigation === 'previous' ) {
159- handlePageChange ( currentPageIndex - 1 ) ;
160- } else if ( navigation === 'close' ) {
161- onClose ?.( ) ;
162- }
163- } ;
146+ < ActionListGroup >
147+ { currentPage . buttons . map ( ( buttonConfig , index ) => {
148+ const { navigation, onClick, ...buttonProps } = buttonConfig ;
149+
150+ // Auto-wire navigation if specified
151+ const handleClick = ( event : React . MouseEvent < HTMLButtonElement > ) => {
152+ // Call user's custom onClick first if provided
153+ onClick ?.( event ) ;
154+
155+ // Then handle navigation
156+ if ( navigation === 'next' ) {
157+ handlePageChange ( currentPageIndex + 1 ) ;
158+ } else if ( navigation === 'previous' ) {
159+ handlePageChange ( currentPageIndex - 1 ) ;
160+ } else if ( navigation === 'close' ) {
161+ onClose ?.( ) ;
162+ }
163+ } ;
164164
165- return (
166- < ActionListItem key = { index } >
167- < Button
168- { ...buttonProps }
169- onClick = { navigation || onClick ? handleClick : undefined }
170- />
171- </ ActionListItem >
172- ) ;
173- } ) }
174- </ ActionListGroup >
165+ return (
166+ < ActionListItem key = { index } >
167+ < Button
168+ { ...buttonProps }
169+ onClick = { navigation || onClick ? handleClick : undefined }
170+ />
171+ </ ActionListItem >
172+ ) ;
173+ } ) }
174+ </ ActionListGroup >
175175 </ ActionList >
176176 </ FlexItem >
177177 ) }
0 commit comments