Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
emotion: HealthPage
  • Loading branch information
aslilac committed Oct 31, 2023
commit b58f25ea214fb5798d7b3579be1983f0a889ed3e
18 changes: 8 additions & 10 deletions site/src/pages/HealthPage/HealthPage.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { type Interpolation, type Theme } from "@emotion/react";
import Box from "@mui/material/Box";
import { useQuery } from "react-query";
import { getHealth } from "api/api";
Expand All @@ -16,7 +17,6 @@ import {
PageHeaderSubtitle,
} from "components/PageHeader/FullWidthPageHeader";
import { Stats, StatsItem } from "components/Stats/Stats";
import { makeStyles } from "@mui/styles";
import { createDayString } from "utils/createDayString";
import { DashboardFullPage } from "components/Dashboard/DashboardLayout";

Expand Down Expand Up @@ -57,8 +57,6 @@ export function HealthPageView({
healthStatus: Awaited<ReturnType<typeof getHealth>>;
tab: ReturnType<typeof useTab>;
}) {
const styles = useStyles();

return (
<DashboardFullPage>
<FullWidthPageHeader sticky={false}>
Expand Down Expand Up @@ -93,14 +91,14 @@ export function HealthPageView({
</div>
</Stack>

<Stats aria-label="Deployment details" className={styles.stats}>
<Stats aria-label="Deployment details" css={styles.stats}>
<StatsItem
className={styles.statsItem}
css={styles.statsItem}
label="Last check"
value={createDayString(healthStatus.time)}
/>
<StatsItem
className={styles.statsItem}
css={styles.statsItem}
label="Coder version"
value={healthStatus.coder_version}
/>
Expand Down Expand Up @@ -212,8 +210,8 @@ export function HealthPageView({
);
}

const useStyles = makeStyles((theme) => ({
stats: {
const styles = {
stats: (theme) => ({
padding: 0,
border: 0,
gap: theme.spacing(6),
Expand All @@ -226,7 +224,7 @@ const useStyles = makeStyles((theme) => ({
alignItems: "flex-start",
gap: theme.spacing(1),
},
},
}),

statsItem: {
flexDirection: "column",
Expand All @@ -238,4 +236,4 @@ const useStyles = makeStyles((theme) => ({
fontWeight: 500,
},
},
}));
} satisfies Record<string, Interpolation<Theme>>;