@@ -5,7 +5,7 @@ import { useMemo, useState } from "react";
55
66import { primaryServerKeybindingsAtom } from "~/state/server" ;
77import { useTheme } from "~/hooks/useTheme" ;
8- import { isMacPlatform , isWindowsPlatform } from "~/lib/utils" ;
8+ import { getLocalFileManagerName , isWindowsPlatform } from "~/lib/utils" ;
99import { CommandPaletteContent } from "../CommandPaletteContent" ;
1010import type { CommandPaletteActionItem } from "../CommandPalette.logic" ;
1111import { CommandPaletteResults } from "../CommandPaletteResults" ;
@@ -15,8 +15,7 @@ import {
1515 PROJECT_FILE_PICKER_RESULT_LIMIT ,
1616} from "../files/ProjectFilePicker.logic" ;
1717import { useProjectFilePickerQuery } from "../files/projectFilesQueryState" ;
18- import { Button } from "../ui/button" ;
19- import { CommandDialog , CommandDialogPopup } from "../ui/command" ;
18+ import { CommandDialog , CommandDialogPopup , CommandFooterAction } from "../ui/command" ;
2019import { toastManager } from "../ui/toast" ;
2120
2221function emptyMessage ( query : string , error : string | null , isPending : boolean ) : string {
@@ -50,12 +49,9 @@ export function ProjectFaviconPickerDialog(props: {
5049 const { resolvedTheme } = useTheme ( ) ;
5150 const keybindings = useAtomValue ( primaryServerKeybindingsAtom ) ;
5251 const pickExternal = props . onPickExternal ;
53- const fileManagerName =
54- typeof navigator !== "undefined" && isMacPlatform ( navigator . platform )
55- ? "Finder"
56- : typeof navigator !== "undefined" && isWindowsPlatform ( navigator . platform )
57- ? "Explorer"
58- : "Files" ;
52+ const fileManagerName = getLocalFileManagerName (
53+ typeof navigator === "undefined" ? "" : navigator . platform ,
54+ ) ;
5955 const items = useMemo < CommandPaletteActionItem [ ] > (
6056 ( ) =>
6157 getProjectFilePickerMatches ( result . entries , result . matchedQuery ) . map ( ( match ) => ( {
@@ -85,10 +81,7 @@ export function ProjectFaviconPickerDialog(props: {
8581 footerActionLabel = "Select icon"
8682 footerTrailing = {
8783 pickExternal ? (
88- < Button
89- variant = "ghost"
90- size = "xs"
91- className = "h-auto px-2 text-muted-foreground text-xs hover:bg-transparent hover:text-foreground"
84+ < CommandFooterAction
9285 disabled = { isPickingExternal }
9386 onClick = { ( ) => {
9487 setIsPickingExternal ( true ) ;
@@ -110,7 +103,7 @@ export function ProjectFaviconPickerDialog(props: {
110103 } }
111104 >
112105 { `Open in ${ fileManagerName } ` }
113- </ Button >
106+ </ CommandFooterAction >
114107 ) : null
115108 }
116109 inputProps = { { placeholder : "Search image files…" } }
0 commit comments