import { openUrl } from "@tauri-apps/plugin-opener"; import { useLicense } from "@yaakapp-internal/license"; import { useRef } from "react"; import { openSettings } from "../commands/openSettings"; import { useCheckForUpdates } from "../hooks/useCheckForUpdates"; import { useExportData } from "../hooks/useExportData"; import { appInfo } from "../lib/appInfo"; import { showDialog } from "../lib/dialog"; import { importData } from "../lib/importData"; import type { DropdownRef } from "./core/Dropdown"; import { Dropdown } from "./core/Dropdown"; import { Icon } from "./core/Icon"; import { IconButton } from "./core/IconButton"; import { KeyboardShortcutsDialog } from "./KeyboardShortcutsDialog"; export function SettingsDropdown() { const exportData = useExportData(); const dropdownRef = useRef(null); const checkForUpdates = useCheckForUpdates(); const { check } = useLicense(); return ( , onSelect: () => openSettings.mutate(null), }, { label: "Keyboard shortcuts", hotKeyAction: "hotkeys.showHelp", leftSlot: , onSelect: () => { showDialog({ id: "hotkey", title: "Keyboard Shortcuts", size: "dynamic", render: () => , }); }, }, { label: "Plugins", leftSlot: , onSelect: () => openSettings.mutate("plugins"), }, { type: "separator", label: "Share Workspace(s)" }, { label: "Import Data", leftSlot: , onSelect: () => importData.mutate(), }, { label: "Export Data", leftSlot: , onSelect: () => exportData.mutate(), }, { label: "Create Run Button", leftSlot: , onSelect: () => openUrl("https://yaak.app/button/new"), }, { type: "separator", label: `Yaak v${appInfo.version}` }, { label: "Check for Updates", leftSlot: , hidden: !appInfo.featureUpdater, onSelect: () => checkForUpdates.mutate(), }, { label: "Purchase License", color: "success", hidden: check.data == null || check.data.status === "active", leftSlot: , rightSlot: , onSelect: () => openUrl("https://yaak.app/pricing"), }, { label: "Install CLI", hidden: appInfo.cliVersion != null, leftSlot: , rightSlot: , onSelect: () => openUrl("https://yaak.app/docs/cli"), }, { label: "Feedback", leftSlot: , rightSlot: , onSelect: () => openUrl("https://yaak.app/feedback"), }, { label: "Changelog", leftSlot: , rightSlot: , onSelect: () => openUrl(`https://yaak.app/changelog/${appInfo.version}`), }, ]} > ); }