@@ -15,6 +15,7 @@ import DocumentStoreCard from '@/ui-component/cards/DocumentStoreCard'
1515import MainCard from '@/ui-component/cards/MainCard'
1616import TablePagination , { DEFAULT_ITEMS_PER_PAGE } from '@/ui-component/pagination/TablePagination'
1717import AddDocStoreDialog from '@/views/docstore/AddDocStoreDialog'
18+ import { getDocStoreActionButtonSx } from '@/views/docstore/actionButtonStyles'
1819import DeleteDocStoreDialog from '@/views/docstore/DeleteDocStoreDialog'
1920
2021// API
@@ -88,14 +89,9 @@ const Documents = () => {
8889 return responseData
8990 }
9091
91- if ( responseData && typeof responseData === 'object' ) {
92- if ( typeof responseData . message === 'string' && responseData . message . trim ( ) ) {
93- return responseData . message
94- }
95-
96- if ( typeof responseData . error === 'string' && responseData . error . trim ( ) ) {
97- return responseData . error
98- }
92+ const responseMessage = responseData && typeof responseData === 'object' ? responseData . message || responseData . error : undefined
93+ if ( typeof responseMessage === 'string' && responseMessage . trim ( ) ) {
94+ return responseMessage
9995 }
10096
10197 if ( typeof error ?. message === 'string' && error . message . trim ( ) ) {
@@ -387,8 +383,8 @@ const Documents = () => {
387383 < React . Fragment >
388384 { ! view || view === 'card' ? (
389385 < Box display = 'grid' gridTemplateColumns = 'repeat(3, 1fr)' gap = { gridSpacing } >
390- { docStores ?. filter ( filterDocStores ) . map ( ( data , index ) => (
391- < Box key = { index } sx = { { position : 'relative' } } >
386+ { docStores ?. filter ( filterDocStores ) . map ( ( data ) => (
387+ < Box key = { data . id } sx = { { position : 'relative' } } >
392388 < DocumentStoreCard
393389 images = { images [ data . id ] }
394390 data = { data }
@@ -406,12 +402,7 @@ const Documents = () => {
406402 zIndex : 2 ,
407403 width : 30 ,
408404 height : 30 ,
409- p : 0.5 ,
410- backgroundColor : theme . palette . background . paper ,
411- border : `1px solid ${ theme . palette . grey [ 900 ] } 25` ,
412- '&:hover' : {
413- backgroundColor : theme . palette . action . hover
414- } ,
405+ ...getDocStoreActionButtonSx ( theme ) ,
415406 [ theme . breakpoints . down ( 'sm' ) ] : {
416407 top : 8 ,
417408 right : 8 ,
0 commit comments