File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed
pages/TrustRoot/components Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -16,16 +16,16 @@ export const useWithUiId = <T>(
1616 /** Source data to modify. */
1717 data : T [ ] | undefined ,
1818 /** Generate the unique id for a specific `T`. */
19- generator : ( item : T ) => string
19+ generator : ( item : T , index : number ) => string
2020) : WithUiId < T > [ ] => {
2121 const result = useMemo ( ( ) => {
2222 if ( ! data || data . length === 0 ) {
2323 return [ ] ;
2424 }
2525
26- const dataWithUiId : WithUiId < T > [ ] = data . map ( ( item ) => ( {
26+ const dataWithUiId : WithUiId < T > [ ] = data . map ( ( item , index ) => ( {
2727 ...item ,
28- [ UI_UNIQUE_ID ] : generator ( item ) ,
28+ [ UI_UNIQUE_ID ] : generator ( item , index ) ,
2929 } ) ) ;
3030
3131 return dataWithUiId ;
Original file line number Diff line number Diff line change @@ -35,7 +35,10 @@ interface ICertificatesTableProps {
3535}
3636
3737export const CertificatesTable : React . FC < ICertificatesTableProps > = ( { certificates, isFetching, fetchError } ) => {
38- const items = useWithUiId ( certificates , ( item ) => `${ item . type } -${ item . issuer } -${ item . subject } -${ item . target } ` ) ;
38+ const items = useWithUiId (
39+ certificates ,
40+ ( item , index ) => `${ index } -${ item . type } -${ item . issuer } -${ item . subject } -${ item . target } `
41+ ) ;
3942
4043 const tableState = usePFToolbarTable ( {
4144 items,
You can’t perform that action at this time.
0 commit comments