@@ -21,6 +21,8 @@ import { BackendAdminSignInGuard } from "../elements/admin_signin_guard";
2121type AdminListProps = {
2222 app : string ;
2323 resource : string ;
24+ hideCreatedAt ?: boolean ;
25+ hideUpdatedAt ?: boolean ;
2426} ;
2527
2628type ListRowType = {
@@ -32,7 +34,7 @@ type ListRowType = {
3234
3335const InnerAdminList : React . FC < AdminListProps > = ErrorBoundary . with (
3436 { fallback : Common . Components . ErrorFallback } ,
35- Suspense . with ( { fallback : < CircularProgress /> } , ( { app, resource } ) => {
37+ Suspense . with ( { fallback : < CircularProgress /> } , ( { app, resource, hideCreatedAt , hideUpdatedAt } ) => {
3638 const navigate = useNavigate ( ) ;
3739 const backendAdminClient = Common . Hooks . BackendAdminAPI . useBackendAdminClient ( ) ;
3840 const listQuery = Common . Hooks . BackendAdminAPI . useListQuery < ListRowType > ( backendAdminClient , app , resource ) ;
@@ -53,8 +55,8 @@ const InnerAdminList: React.FC<AdminListProps> = ErrorBoundary.with(
5355 < TableRow >
5456 < TableCell sx = { { width : "25%" } } > ID</ TableCell >
5557 < TableCell sx = { { width : "40%" } } > 이름</ TableCell >
56- < TableCell sx = { { width : "17.5%" } } > 생성 시간</ TableCell >
57- < TableCell sx = { { width : "17.5%" } } > 수정 시간</ TableCell >
58+ { hideCreatedAt === true && < TableCell sx = { { width : "17.5%" } } > 생성 시간</ TableCell > }
59+ { hideUpdatedAt === true && < TableCell sx = { { width : "17.5%" } } > 수정 시간</ TableCell > }
5860 </ TableRow >
5961 </ TableHead >
6062 < TableBody >
@@ -66,8 +68,8 @@ const InnerAdminList: React.FC<AdminListProps> = ErrorBoundary.with(
6668 < TableCell >
6769 < Link to = { `/${ app } /${ resource } /${ item . id } ` } > { item . str_repr } </ Link >
6870 </ TableCell >
69- < TableCell > { new Date ( item . created_at ) . toLocaleString ( ) } </ TableCell >
70- < TableCell > { new Date ( item . updated_at ) . toLocaleString ( ) } </ TableCell >
71+ { hideCreatedAt === true && < TableCell > { new Date ( item . created_at ) . toLocaleString ( ) } </ TableCell > }
72+ { hideUpdatedAt === true && < TableCell > { new Date ( item . updated_at ) . toLocaleString ( ) } </ TableCell > }
7173 </ TableRow >
7274 ) ) }
7375 </ TableBody >
0 commit comments