Skip to content

Commit d7110c5

Browse files
committed
fix: update import
1 parent 9e00ea6 commit d7110c5

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

site/src/pages/WorkspaceBuildPage/WorkspaceBuildPageView.tsx

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import {
2525
} from "modules/workspaces/WorkspaceBuild/WorkspaceBuildData";
2626
import { Sidebar, SidebarCaption, SidebarItem } from "./Sidebar";
2727
import { TAB_PADDING_X, TabLink, Tabs, TabsList } from "components/Tabs/Tabs";
28-
import { useTab } from "hooks";
28+
import { useSearchParamsKey } from "hooks/useSearchParamsKey";
2929
import { AgentLogs, useAgentLogs } from "modules/resources/AgentLogs";
3030

3131
export const LOGS_TAB_KEY = "logs";
@@ -51,14 +51,17 @@ export const WorkspaceBuildPageView: FC<WorkspaceBuildPageViewProps> = ({
5151
activeBuildNumber,
5252
}) => {
5353
const theme = useTheme();
54-
const tab = useTab(LOGS_TAB_KEY, "build");
54+
const tabState = useSearchParamsKey({
55+
key: LOGS_TAB_KEY,
56+
defaultValue: "build",
57+
});
5558

5659
if (!build) {
5760
return <Loader />;
5861
}
5962

6063
const agents = build.resources.flatMap((r) => r.agents ?? []);
61-
const selectedAgent = agents.find((a) => a.id === tab.value);
64+
const selectedAgent = agents.find((a) => a.id === tabState.value);
6265

6366
return (
6467
<DashboardFullPage>
@@ -141,7 +144,7 @@ export const WorkspaceBuildPageView: FC<WorkspaceBuildPageViewProps> = ({
141144
</Sidebar>
142145

143146
<div css={{ height: "100%", overflowY: "auto", width: "100%" }}>
144-
<Tabs active={tab.value}>
147+
<Tabs active={tabState.value}>
145148
<TabsList>
146149
<TabLink to={`?${LOGS_TAB_KEY}=build`} value="build">
147150
Build
@@ -187,7 +190,7 @@ export const WorkspaceBuildPageView: FC<WorkspaceBuildPageViewProps> = ({
187190
</Alert>
188191
)}
189192

190-
{tab.value === "build" ? (
193+
{tabState.value === "build" ? (
191194
<BuildLogsContent logs={logs} />
192195
) : (
193196
<AgentLogsContent agent={selectedAgent!} />

0 commit comments

Comments
 (0)