Skip to content

Commit 24a8dfd

Browse files
committed
ui fix linting errors
1 parent 629ce6c commit 24a8dfd

File tree

2 files changed

+39
-33
lines changed

2 files changed

+39
-33
lines changed

ui/litellm-dashboard/src/components/transform_request.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ ${formattedBody}
156156
}}>
157157
<div style={{ marginBottom: '24px' }}>
158158
<h2 style={{ fontSize: '24px', fontWeight: 'bold', margin: '0 0 4px 0' }}>Original Request</h2>
159-
<p style={{ color: '#666', margin: 0 }}>The request you would send to LiteLLM's /chat/completions endpoint.</p>
159+
<p style={{ color: '#666', margin: 0 }}>The request you would send to LiteLLM /chat/completions endpoint.</p>
160160
</div>
161161

162162
<textarea

ui/litellm-dashboard/src/components/view_logs/columns.tsx

+38-32
Original file line numberDiff line numberDiff line change
@@ -37,41 +37,47 @@ export const columns: ColumnDef<LogEntry>[] = [
3737
id: "expander",
3838
header: () => null,
3939
cell: ({ row }) => {
40-
const [localExpanded, setLocalExpanded] = React.useState(row.getIsExpanded());
40+
// Convert the cell function to a React component to properly use hooks
41+
const ExpanderCell = () => {
42+
const [localExpanded, setLocalExpanded] = React.useState(row.getIsExpanded());
4143

42-
// Memoize the toggle handler to prevent unnecessary re-renders
43-
const toggleHandler = React.useCallback(() => {
44-
setLocalExpanded((prev) => !prev);
45-
row.getToggleExpandedHandler()();
46-
}, [row]);
44+
// Memoize the toggle handler to prevent unnecessary re-renders
45+
const toggleHandler = React.useCallback(() => {
46+
setLocalExpanded((prev) => !prev);
47+
row.getToggleExpandedHandler()();
48+
}, [row]);
4749

48-
return row.getCanExpand() ? (
49-
<button
50-
onClick={toggleHandler}
51-
style={{ cursor: "pointer" }}
52-
aria-label={localExpanded ? "Collapse row" : "Expand row"}
53-
className="w-6 h-6 flex items-center justify-center focus:outline-none"
54-
>
55-
<svg
56-
className={`w-4 h-4 transform transition-transform duration-75 ${
57-
localExpanded ? 'rotate-90' : ''
58-
}`}
59-
fill="none"
60-
stroke="currentColor"
61-
viewBox="0 0 24 24"
62-
xmlns="http://www.w3.org/2000/svg"
50+
return row.getCanExpand() ? (
51+
<button
52+
onClick={toggleHandler}
53+
style={{ cursor: "pointer" }}
54+
aria-label={localExpanded ? "Collapse row" : "Expand row"}
55+
className="w-6 h-6 flex items-center justify-center focus:outline-none"
6356
>
64-
<path
65-
strokeLinecap="round"
66-
strokeLinejoin="round"
67-
strokeWidth={2}
68-
d="M9 5l7 7-7 7"
69-
/>
70-
</svg>
71-
</button>
72-
) : (
73-
<span className="w-6 h-6 flex items-center justify-center"></span>
74-
);
57+
<svg
58+
className={`w-4 h-4 transform transition-transform duration-75 ${
59+
localExpanded ? 'rotate-90' : ''
60+
}`}
61+
fill="none"
62+
stroke="currentColor"
63+
viewBox="0 0 24 24"
64+
xmlns="http://www.w3.org/2000/svg"
65+
>
66+
<path
67+
strokeLinecap="round"
68+
strokeLinejoin="round"
69+
strokeWidth={2}
70+
d="M9 5l7 7-7 7"
71+
/>
72+
</svg>
73+
</button>
74+
) : (
75+
<span className="w-6 h-6 flex items-center justify-center"></span>
76+
);
77+
};
78+
79+
// Return the component
80+
return <ExpanderCell />;
7581
},
7682
},
7783
{

0 commit comments

Comments
 (0)