diff --git a/site/src/modules/resources/AgentMetadata.tsx b/site/src/modules/resources/AgentMetadata.tsx index f05355f33c50e..2517ae9115e9e 100644 --- a/site/src/modules/resources/AgentMetadata.tsx +++ b/site/src/modules/resources/AgentMetadata.tsx @@ -1,4 +1,3 @@ -import type { Interpolation, Theme } from "@emotion/react"; import Skeleton from "@mui/material/Skeleton"; import Tooltip from "@mui/material/Tooltip"; import { watchAgentMetadata } from "api/api"; @@ -18,7 +17,7 @@ import { useRef, useState, } from "react"; -import { MONOSPACE_FONT_FAMILY } from "theme/constants"; +import { cn } from "utils/cn"; import type { OneWayWebSocket } from "utils/OneWayWebSocket"; type ItemStatus = "stale" | "valid" | "loading"; @@ -32,7 +31,7 @@ export const AgentMetadataView: FC = ({ metadata }) => { return null; } return ( -
+
{metadata.map((m) => ( ))} @@ -122,7 +121,7 @@ export const AgentMetadata: FC = ({ if (activeMetadata === undefined) { return ( -
+
); @@ -134,17 +133,17 @@ export const AgentMetadata: FC = ({ const AgentMetadataSkeleton: FC = () => { return ( -
+
-
+
-
+
@@ -182,29 +181,29 @@ const MetadataItem: FC = ({ item }) => { // could be buggy. But, how common is that anyways? const value = status === "loading" ? ( - + ) : status === "stale" ? ( - + {item.result.value} ) : ( 0 && "text-content-destructive", + )} > {item.result.value} ); return ( -
-
{item.description.display_name}
+
+
+ {item.description.display_name} +
{value}
); @@ -236,65 +235,3 @@ const StaticWidth: FC> = ({
); }; - -// These are more or less copied from -// site/src/modules/resources/ResourceCard.tsx -const styles = { - root: { - display: "flex", - alignItems: "baseline", - flexWrap: "wrap", - gap: 32, - rowGap: 16, - }, - - metadata: { - lineHeight: "1.6", - display: "flex", - flexDirection: "column", - overflow: "visible", - flexShrink: 0, - }, - - metadataLabel: (theme) => ({ - color: theme.palette.text.secondary, - textOverflow: "ellipsis", - overflow: "hidden", - whiteSpace: "nowrap", - fontSize: 13, - }), - - metadataValue: { - textOverflow: "ellipsis", - overflow: "hidden", - whiteSpace: "nowrap", - maxWidth: "16em", - fontSize: 14, - }, - - metadataValueSuccess: (theme) => ({ - color: theme.roles.success.fill.outline, - }), - - metadataValueError: (theme) => ({ - color: theme.palette.error.main, - }), - - metadataStale: (theme) => ({ - color: theme.palette.text.disabled, - cursor: "pointer", - }), - - skeleton: { - marginTop: 4, - }, - - inlineCommand: (theme) => ({ - fontFamily: MONOSPACE_FONT_FAMILY, - display: "inline-block", - fontWeight: 600, - margin: 0, - borderRadius: 4, - color: theme.palette.text.primary, - }), -} satisfies Record>; diff --git a/site/src/modules/resources/AgentOutdatedTooltip.tsx b/site/src/modules/resources/AgentOutdatedTooltip.tsx index 03cf7ed6a7a3f..113762648ebc6 100644 --- a/site/src/modules/resources/AgentOutdatedTooltip.tsx +++ b/site/src/modules/resources/AgentOutdatedTooltip.tsx @@ -1,4 +1,3 @@ -import { useTheme } from "@emotion/react"; import type { WorkspaceAgent } from "api/typesGenerated"; import { PopoverTrigger } from "components/deprecated/Popover/Popover"; import { @@ -27,11 +26,6 @@ export const AgentOutdatedTooltip: FC = ({ status, onUpdate, }) => { - const theme = useTheme(); - const versionLabelStyles = { - fontWeight: 600, - color: theme.palette.text.primary, - }; const title = status === agentVersionStatus.Outdated ? "Agent Outdated" @@ -45,7 +39,7 @@ export const AgentOutdatedTooltip: FC = ({ return ( - + {status === agentVersionStatus.Outdated ? "Outdated" : "Deprecated"} @@ -57,12 +51,16 @@ export const AgentOutdatedTooltip: FC = ({
- Agent version + + Agent version + {agent.version} - Server version + + Server version + {serverVersion} diff --git a/site/src/modules/resources/AppLink/AppLink.tsx b/site/src/modules/resources/AppLink/AppLink.tsx index 637f0287a4088..5d27eae8a9630 100644 --- a/site/src/modules/resources/AppLink/AppLink.tsx +++ b/site/src/modules/resources/AppLink/AppLink.tsx @@ -1,4 +1,3 @@ -import { useTheme } from "@emotion/react"; import type * as TypesGen from "api/typesGenerated"; import { DropdownMenuItem } from "components/DropdownMenu/DropdownMenu"; import { Spinner } from "components/Spinner/Spinner"; @@ -41,7 +40,6 @@ export const AppLink: FC = ({ const { proxy } = useProxy(); const host = proxy.preferredWildcardHostname; const [iconError, setIconError] = useState(false); - const theme = useTheme(); const link = useAppLink(app, { agent, workspace }); // canClick is ONLY false when it's a subdomain app and the admin hasn't @@ -64,8 +62,7 @@ export const AppLink: FC = ({ icon = (