1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00
lens/src/renderer/components/layout/main-layout-header.tsx
Alex Andreev 665ed94128
Adding cluster settings icon into dashboard (#1672)
Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
2020-12-08 10:31:58 +03:00

33 lines
925 B
TypeScript

import React from "react";
import { Trans } from "@lingui/macro";
import { clusterSettingsURL } from "../+cluster-settings";
import { broadcastMessage } from "../../../common/ipc";
import { Cluster } from "../../../main/cluster";
import { cssNames } from "../../utils";
import { Icon } from "../icon";
interface Props {
cluster: Cluster
className?: string
}
export function MainLayoutHeader({ cluster, className }: Props) {
return (
<header className={cssNames("flex gaps align-center justify-space-between", className)}>
<span className="cluster">{cluster.name}</span>
<Icon
material="settings"
tooltip={<Trans>Open cluster settings</Trans>}
interactive
onClick={() => {
broadcastMessage("renderer:navigate", clusterSettingsURL({
params: {
clusterId: cluster.id
}
}));
}}
/>
</header>
);
}