Shun Miyazawa 4 лет назад
Родитель
Сommit
72e6754497

+ 2 - 2
packages/app/src/components/Admin/AuditLog.tsx

@@ -4,7 +4,7 @@ import { useTranslation } from 'react-i18next';
 
 
 import { useSWRxActivityList } from '~/stores/activity';
 import { useSWRxActivityList } from '~/stores/activity';
 
 
-import ActivityTable from './AuditLog/ActivityTable';
+import { AuditLogManagement } from './AuditLog/AuditLogManagement';
 
 
 const AuditLog: FC = () => {
 const AuditLog: FC = () => {
   const { t } = useTranslation();
   const { t } = useTranslation();
@@ -15,7 +15,7 @@ const AuditLog: FC = () => {
   return (
   return (
     <div data-testid="admin-auditlog">
     <div data-testid="admin-auditlog">
       <h2>{t('AuditLog')}</h2>
       <h2>{t('AuditLog')}</h2>
-      <ActivityTable activityList={activityList} />
+      <AuditLogManagement activityList={activityList} />
     </div>
     </div>
   );
   );
 };
 };

+ 0 - 44
packages/app/src/components/Admin/AuditLog/ActivityTable.tsx

@@ -1,44 +0,0 @@
-import React, { FC } from 'react';
-
-import { format } from 'date-fns';
-
-import { IActivityHasId } from '~/interfaces/activity';
-
-type Props = {
-  activityList: IActivityHasId[]
-}
-
-const formatDate = (date) => {
-  return format(new Date(date), 'yyyy/MM/dd HH:mm:ss');
-};
-
-const ActivityTable: FC<Props> = (props: Props) => {
-  return (
-    <div className="table-responsive text-nowrap h-100">
-      <table className="table table-default table-bordered table-user-list">
-        <thead>
-          <tr>
-            <th scope="col">username</th>
-            <th scope="col">targetModel</th>
-            <th scope="col">action</th>
-            <th scope="col">createdAt</th>
-          </tr>
-        </thead>
-        <tbody>
-          {props.activityList.map((activity) => {
-            return (
-              <tr data-testid="user-table-tr" key={activity._id}>
-                <td>{activity.user?.username}</td>
-                <td>{activity.targetModel}</td>
-                <td>{activity.action}</td>
-                <td>{formatDate(activity.createdAt)}</td>
-              </tr>
-            );
-          })}
-        </tbody>
-      </table>
-    </div>
-  );
-};
-
-export default ActivityTable;