fix createdAt in history
This commit is contained in:
parent
bd8511fe97
commit
feb64933de
@ -15,9 +15,10 @@ interface AccordionWrapperProps {
|
||||
content: KeyValue[];
|
||||
last?: boolean;
|
||||
first?: boolean;
|
||||
createdAt: string
|
||||
}
|
||||
|
||||
export default function AccordionWrapper({ content, last, first }: AccordionWrapperProps) {
|
||||
export default function AccordionWrapper({ content, last, first, createdAt }: AccordionWrapperProps) {
|
||||
const theme = useTheme();
|
||||
const upMd = useMediaQuery(theme.breakpoints.up("md"));
|
||||
const upSm = useMediaQuery(theme.breakpoints.up("sm"));
|
||||
@ -25,7 +26,7 @@ export default function AccordionWrapper({ content, last, first }: AccordionWrap
|
||||
const isMobile = useMediaQuery(theme.breakpoints.down(560));
|
||||
|
||||
const valuesByKey: any = {};
|
||||
|
||||
console.log(content)
|
||||
content.forEach((item) => {
|
||||
valuesByKey[item.Key] = item.Value;
|
||||
});
|
||||
@ -81,7 +82,7 @@ export default function AccordionWrapper({ content, last, first }: AccordionWrap
|
||||
whiteSpace: "nowrap",
|
||||
}}
|
||||
>
|
||||
{extractDateFromString(valuesByKey.createdat)}
|
||||
{extractDateFromString(createdAt)}
|
||||
</Typography>
|
||||
|
||||
<Typography
|
||||
|
@ -65,12 +65,13 @@ export default function History() {
|
||||
) : (
|
||||
<Tabs items={subPages} selectedItem={selectedItem} setSelectedItem={setSelectedItem} />
|
||||
)}
|
||||
{historyData?.records.map(({ rawDetails }, index) => (
|
||||
{historyData?.records.map(( e, index) => (
|
||||
<Box key={index} sx={{ mt: index === 0 ? "27px" : "0px" }}>
|
||||
<AccordionWrapper
|
||||
first={index === 0}
|
||||
last={index === historyData?.records.length - 1}
|
||||
content={rawDetails[0]}
|
||||
content={e.rawDetails[0]}
|
||||
createdAt={e.createdAt}
|
||||
/>
|
||||
</Box>
|
||||
))}
|
||||
|
Loading…
Reference in New Issue
Block a user