From 160cb923fccf794e43a49aba1f5d98922f6e00ad Mon Sep 17 00:00:00 2001 From: "use-tusk[bot]" Date: Wed, 16 Oct 2024 19:50:06 +0000 Subject: [PATCH] fix(11372792741): auto linting --- .../templates/requestsV2/RequestsTable.tsx | 99 +++++++++---------- .../requestsV2/builder/requestBuilder.tsx | 15 ++- 2 files changed, 61 insertions(+), 53 deletions(-) diff --git a/web/components/templates/requestsV2/RequestsTable.tsx b/web/components/templates/requestsV2/RequestsTable.tsx index dcedfad84..5610b7363 100644 --- a/web/components/templates/requestsV2/RequestsTable.tsx +++ b/web/components/templates/requestsV2/RequestsTable.tsx @@ -1,9 +1,5 @@ -import React from 'react'; -import { - useTable, - useSortBy, - usePagination, -} from 'react-table'; +import React from "react"; +import { useTable, useSortBy, usePagination } from "react-table"; interface Request { request_id: string; @@ -22,45 +18,42 @@ interface RequestsTableProps { } const RequestsTable: React.FC = ({ requests }) => { - const data = React.useMemo( - () => requests, - [requests] - ); + const data = React.useMemo(() => requests, [requests]); const columns = React.useMemo( () => [ { - Header: 'Created At', - accessor: 'created_at', + Header: "Created At", + accessor: "created_at", }, { - Header: 'Status', - accessor: 'status', + Header: "Status", + accessor: "status", }, { - Header: 'User', - accessor: 'user', + Header: "User", + accessor: "user", }, { - Header: 'Cost', - accessor: 'cost', + Header: "Cost", + accessor: "cost", }, { - Header: 'Model', - accessor: 'model', - Cell: ({ cell: { value } }) => value || 'Unsupported', + Header: "Model", + accessor: "model", + Cell: ({ cell: { value } }) => value || "Unsupported", }, { - Header: 'Request', - accessor: 'request_text', + Header: "Request", + accessor: "request_text", }, { - Header: 'Response', - accessor: 'response_text', + Header: "Response", + accessor: "response_text", }, { - Header: 'Prompt Tokens', - accessor: 'prompt_tokens', + Header: "Prompt Tokens", + accessor: "prompt_tokens", }, ], [] @@ -96,16 +89,22 @@ const RequestsTable: React.FC = ({ requests }) => { {headerGroups.map((headerGroup, index) => ( - + {headerGroup.headers.map((column, columnIndex) => ( - ))} @@ -120,7 +119,7 @@ const RequestsTable: React.FC = ({ requests }) => { {row.cells.map((cell, cellIndex) => { return ( ); })} @@ -132,42 +131,42 @@ const RequestsTable: React.FC = ({ requests }) => {
{' '} + {"<<"} + {" "} {' '} + {"<"} + {" "} {' '} + {">"} + {" "} {' '} + {">>"} + {" "} - Page{' '} + Page{" "} {pageIndex + 1} of {pageOptions.length} - {' '} + {" "} - | Go to page:{' '} + | Go to page:{" "} { + onChange={(e) => { const page = e.target.value ? Number(e.target.value) - 1 : 0; gotoPage(page); }} - style={{ width: '100px' }} + style={{ width: "100px" }} /> - {' '} + {" "}
- {column.render('Header')} + + {column.render("Header")} {column.isSorted ? column.isSortedDesc - ? ' 🔽' - : ' 🔼' - : ''} + ? " 🔽" + : " 🔼" + : ""} - {cell.render('Cell')} + {cell.render("Cell")}