diff --git a/src/components/command-menu.tsx b/src/components/command-menu.tsx index 0ab5856..972605b 100644 --- a/src/components/command-menu.tsx +++ b/src/components/command-menu.tsx @@ -13,7 +13,6 @@ import { } from "@/components/ui/command"; import { Button } from "./ui/button"; import { CommandIcon } from "lucide-react"; -import { useOS } from "@/hooks/useOS"; interface Props { links: { url: string; title: string }[]; @@ -21,7 +20,6 @@ interface Props { export const CommandMenu = ({ links }: Props) => { const [open, setOpen] = React.useState(false); - const os = useOS(); React.useEffect(() => { const down = (e: KeyboardEvent) => { @@ -40,7 +38,7 @@ export const CommandMenu = ({ links }: Props) => {
Press{" "} - {os === "mac" ? "⌘" : "CTRL"}+ J + ⌘J {" "} to open the command menu
diff --git a/src/hooks/useOS.ts b/src/hooks/useOS.ts deleted file mode 100644 index 7f21564..0000000 --- a/src/hooks/useOS.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { useMemo } from "react"; - -export type OS = "mac" | "windows" | "linux" | "other"; - -export const useOS = (): OS => { - const getOperatingSystem = (): OS => { - const userAgent = window.navigator.userAgent.toLowerCase(); - - if (userAgent.includes("mac")) return "mac"; - if (userAgent.includes("win")) return "windows"; - if (userAgent.includes("linux")) return "linux"; - - return "other"; - }; - - return useMemo(() => getOperatingSystem(), []); -};