/* * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ import React from 'react'; import { ColumnLayout, SpaceBetween } from '@awsui/components-react'; import TextAttribute from "./TextAttribute"; import {getNestedValuePath} from "../../resources/main"; // Attribute Display message content function returnLocaleDateTime(stringDateTime) { let originalDate = new Date(stringDateTime); let newDate = new Date(originalDate.getTime() - originalDate.getTimezoneOffset()*60*1000); return newDate.toLocaleString(); } const Audit = ({item}) => { function getHistoryUser(item, type){ const value = getNestedValuePath(item, '_history.' + type + '.email') if (value){ return value; } else { return '-' } } function getHistoryDate(item, type){ const value = getNestedValuePath(item, '_history.' + type) if (value){ return value; } else { return '-' } } return (
{getHistoryUser(item,'createdBy')} {getHistoryDate(item, 'createdTimestamp')}
{getHistoryUser(item,'lastModifiedBy')} {getHistoryDate(item, 'lastModifiedTimestamp')}
) }; export default Audit;