Improve code quality

Fix lint warnings
This commit is contained in:
Przemek Więch
2026-05-10 21:56:51 +02:00
parent ea82bc4c98
commit 8202c9cd05
29 changed files with 315 additions and 221 deletions

View File

@@ -51,7 +51,7 @@ export function TopBar(props: Props) {
}
function chartMenus(screenSize: ScreenSize) {
if (!props.showingChart) {
if (!props.showingChart || !props.data) {
return null;
}
const chartTypeItems = (
@@ -147,7 +147,7 @@ export function TopBar(props: Props) {
<Dropdown.Menu>{chartTypeItems}</Dropdown.Menu>
</Dropdown>
<SearchBar
data={props.data!}
data={props.data}
onSelection={props.eventHandlers.onSelection}
{...props}
/>
@@ -312,9 +312,9 @@ export function TopBar(props: Props) {
<div className="topbar--title">
{props.standalone ? <Link to="/">{title()}</Link> : title()}
</div>
{props.showingChart && (
{props.showingChart && props.data && (
<SearchBar
data={props.data!}
data={props.data}
onSelection={props.eventHandlers.onSelection}
{...props}
/>