ActivityListItem.tsx 702 B

12345678910111213141516171819202122232425
  1. import type { IPageHasId } from '@growi/core';
  2. import type { IActivityHasId } from '~/interfaces/activity';
  3. import { PageListItemS } from '../PageList/PageListItemS';
  4. // Define the component's props interface
  5. type ActivityWithPageTarget = IActivityHasId & { target: IPageHasId };
  6. export const ActivityListItem = ({ activity }: { activity: ActivityWithPageTarget }): JSX.Element => {
  7. const action = activity.action;
  8. const date = new Date(activity.createdAt).toLocaleString();
  9. return (
  10. <div className="activity-row">
  11. <p className="text-muted small mb-1">
  12. **{}** performed **{action}** on {date}
  13. </p>
  14. <PageListItemS page={activity.target} />
  15. </div>
  16. );
  17. };