@@ -211,40 +211,66 @@ export default function CustomTable({
211211 </ TableHead >
212212
213213 < TableBody >
214- { rows . map ( ( row , idx ) => (
215- < TableRow
216- key = { idx }
217- hover
218- onClick = { ( ) => onRowClick ?. ( row ) }
219- sx = { { cursor : "pointer" } }
220- >
221- { columns . map ( ( col ) => (
222- < TableCell key = { col . key } >
223- { renderCell ( col , row [ col . key ] , row , theme , companies ) }
224- </ TableCell >
225- ) ) }
226- { userRole === "ROLE_SYSTEM_ADMIN" &&
227- ! hideDeleteButton &&
228- ! row . deleted && (
229- < TableCell key = "__actions__" align = "center" >
230- < CustomButton
231- kind = "ghost-danger"
232- size = "small"
233- onClick = { ( e ) => {
234- e . stopPropagation ( ) ;
235- onDelete ?. ( row ) ;
236- } }
237- >
238- 삭제
239- </ CustomButton >
214+ { rows . length > 0 ? (
215+ rows . map ( ( row , idx ) => (
216+ < TableRow
217+ key = { idx }
218+ hover
219+ onClick = { ( ) => onRowClick ?. ( row ) }
220+ sx = { { cursor : "pointer" } }
221+ >
222+ { columns . map ( ( col ) => (
223+ < TableCell key = { col . key } >
224+ { renderCell ( col , row [ col . key ] , row , theme , companies ) }
240225 </ TableCell >
241- ) }
226+ ) ) }
227+ { userRole === "ROLE_SYSTEM_ADMIN" &&
228+ ! hideDeleteButton &&
229+ ! row . deleted && (
230+ < TableCell key = "__actions__" align = "center" >
231+ < CustomButton
232+ kind = "ghost-danger"
233+ size = "small"
234+ onClick = { ( e ) => {
235+ e . stopPropagation ( ) ;
236+ onDelete ?. ( row ) ;
237+ } }
238+ >
239+ 삭제
240+ </ CustomButton >
241+ </ TableCell >
242+ ) }
243+ </ TableRow >
244+ ) )
245+ ) : (
246+ < TableRow >
247+ < TableCell
248+ colSpan = { fullColumns . length }
249+ sx = { {
250+ height : 200 ,
251+ p : 0 ,
252+ } }
253+ >
254+ < Box
255+ sx = { {
256+ display : "flex" ,
257+ justifyContent : "center" ,
258+ alignItems : "center" ,
259+ height : "100%" ,
260+ width : "100%" ,
261+ } }
262+ >
263+ < Typography variant = "body2" color = "text.secondary" >
264+ 등록된 데이터가 없습니다.
265+ </ Typography >
266+ </ Box >
267+ </ TableCell >
242268 </ TableRow >
243- ) ) }
269+ ) }
244270 </ TableBody >
245271 </ Table >
246272
247- { pagination && (
273+ { pagination && rows . length > 0 && (
248274 < Box p = { 2 } >
249275 < Stack direction = "row" justifyContent = "flex-end" >
250276 < Pagination
0 commit comments