Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit5ec285c

Browse files
committed
feat: empty and loading states on<RequestLogsPageView /> table
1 parent2c01605 commit5ec285c

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

‎site/src/pages/AIGovernancePage/RequestLogsPage/RequestLogsPage.tsx‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@ const RequestLogsPage: FC = () => {
1111
<>
1212
<title>{pageTitle("AI Governance","Request Logs")}</title>
1313

14-
<RequestLogsPageViewinterceptions={interceptionsQuery.data?.results}/>
14+
<RequestLogsPageView
15+
isLoading={interceptionsQuery.isLoading}
16+
interceptions={interceptionsQuery.data?.results}
17+
/>
1518
</>
1619
);
1720
};

‎site/src/pages/AIGovernancePage/RequestLogsPage/RequestLogsPageView.tsx‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,18 @@ import {
66
TableHeader,
77
TableRow,
88
}from"components/Table/Table";
9+
import{TableEmpty}from"components/TableEmpty/TableEmpty";
10+
import{TableLoader}from"components/TableLoader/TableLoader";
911
importtype{FC}from"react";
1012
import{RequestLogsRow}from"./RequestLogsRow/RequestLogsRow";
1113

1214
interfaceRequestLogsPageViewProps{
15+
isLoading:boolean;
1316
interceptions?:readonlyAIBridgeInterception[];
1417
}
1518

1619
exportconstRequestLogsPageView:FC<RequestLogsPageViewProps>=({
20+
isLoading,
1721
interceptions,
1822
})=>{
1923
return(
@@ -29,6 +33,10 @@ export const RequestLogsPageView: FC<RequestLogsPageViewProps> = ({
2933
</TableRow>
3034
</TableHeader>
3135
<TableBody>
36+
{isLoading&&<TableLoader/>}
37+
{interceptions?.length===0&&(
38+
<TableEmptymessage={"No request logs available"}/>
39+
)}
3240
{interceptions?.map((interception)=>(
3341
<RequestLogsRowinterception={interception}key={interception.id}/>
3442
))}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp