-
Notifications
You must be signed in to change notification settings - Fork 518
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #535 from microsoft/wotey/status
addition off Status component and new Panel for Status log
- Loading branch information
Showing
3 changed files
with
105 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
app/frontend/src/components/StatusContent/StatusContent.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT license. | ||
|
||
import React, { useEffect, useMemo, useState } from "react"; | ||
import { Text } from "@fluentui/react"; | ||
import { Label } from '@fluentui/react/lib/Label'; | ||
import { Separator } from '@fluentui/react/lib/Separator'; | ||
import { getInfoData, GetInfoResponse } from "../../api"; | ||
|
||
interface Props { | ||
className?: string; | ||
item?: any; | ||
} | ||
interface Stat { | ||
status_timestamp: string; | ||
status: string; // replace 'string' with the actual type of 'timestamp' | ||
// include other properties of 'stat' here | ||
} | ||
export const StatusContent = ({ item }: Props) => { | ||
const data = item.status_updates.reverse(); | ||
// .sort((a: any, b: any) => new Date(b.status_timestamp).getTime() - new Date(a.status_timestamp).getTime()); | ||
const DisplayData=data.map( | ||
(stat: Stat)=>{ | ||
return( | ||
<tr> | ||
<td>{stat.status}</td> | ||
<td>{stat.status_timestamp.toString()}</td> | ||
</tr> | ||
) | ||
} | ||
) | ||
|
||
return ( | ||
<div> | ||
<Label>File Name</Label><Text>{item?.name}</Text> | ||
<table className="table table-striped"> | ||
<thead> | ||
<tr> | ||
<th>Status</th> | ||
<th>Timestamp</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
{DisplayData} | ||
</tbody> | ||
</table> | ||
</div> | ||
); | ||
}; |