Skip to content

Commit 62d40e7

Browse files
Disallow ternary expressions
1 parent 0f9fdd3 commit 62d40e7

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

web/src/components/panel/GenericPanel.tsx

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -101,13 +101,15 @@ function GenericPanel({
101101
contentClassName // This should now define the padding e.g. 'p-3 md:p-4'
102102
)}
103103
>
104-
{isLoading ? (
105-
<LoadingSpinner />
106-
) : error ? (
107-
<div className="p-3 text-center text-red-500 md:p-4">{error}</div>
108-
) : (
109-
children
110-
)}
104+
{(() => {
105+
if (isLoading) {
106+
return <LoadingSpinner />;
107+
}
108+
if (error) {
109+
return <div className="p-3 text-center text-red-500 md:p-4">{error}</div>;
110+
}
111+
return children;
112+
})()}
111113
</div>
112114
</GlassContainer>
113115
);

0 commit comments

Comments
 (0)