import { getCurrentWebviewWindow } from "@tauri-apps/api/webviewWindow"; import { type } from "@tauri-apps/plugin-os"; import { settingsAtom } from "@yaakapp-internal/models"; import classNames from "classnames"; import { useAtomValue } from "jotai"; import { useState } from "react"; import { WINDOW_CONTROLS_WIDTH } from "../lib/constants"; import { Button } from "./core/Button"; import { HStack } from "./core/Stacks"; interface Props { className?: string; onlyX?: boolean; macos?: boolean; } export function WindowControls({ className, onlyX }: Props) { const [maximized, setMaximized] = useState(false); const settings = useAtomValue(settingsAtom); // Never show controls on macOS or if hideWindowControls is true if (type() === "macos" || settings.hideWindowControls || settings.useNativeTitlebar) { return null; } return ( {!onlyX && ( <> )} ); }