diff --git a/apps/client/src/widgets/launch_bar/AiChatButton.tsx b/apps/client/src/widgets/launch_bar/AiChatButton.tsx deleted file mode 100644 index cd0d05e08..000000000 --- a/apps/client/src/widgets/launch_bar/AiChatButton.tsx +++ /dev/null @@ -1,16 +0,0 @@ -import FNote from "../../entities/fnote"; -import { useTriliumOptionBool } from "../react/hooks"; -import { LaunchBarActionButton, useLauncherIconAndTitle } from "./launch_bar_widgets"; - -export default function AiChatButton({ launcherNote }: { launcherNote: FNote }) { - const [ aiEnabled ] = useTriliumOptionBool("aiEnabled"); - const { icon, title } = useLauncherIconAndTitle(launcherNote); - - return aiEnabled && ( - - ) -} diff --git a/apps/client/src/widgets/launch_bar/LauncherContainer.tsx b/apps/client/src/widgets/launch_bar/LauncherContainer.tsx index 5d48bc645..4ec648b52 100644 --- a/apps/client/src/widgets/launch_bar/LauncherContainer.tsx +++ b/apps/client/src/widgets/launch_bar/LauncherContainer.tsx @@ -8,8 +8,7 @@ import BookmarkButtons from "./BookmarkButtons"; import ProtectedSessionStatusWidget from "./ProtectedSessionStatusWidget"; import SyncStatus from "./SyncStatus"; import HistoryNavigationButton from "./HistoryNavigation"; -import { CommandButton, CustomWidget, NoteLauncher, QuickSearchLauncherWidget, ScriptLauncher, TodayLauncher } from "./LauncherDefinitions"; -import AiChatButton from "./AiChatButton"; +import AiChatButton, { CommandButton, CustomWidget, NoteLauncher, QuickSearchLauncherWidget, ScriptLauncher, TodayLauncher } from "./LauncherDefinitions"; import { useTriliumEvent } from "../react/hooks"; export default function LauncherContainer({ isHorizontalLayout }: { isHorizontalLayout: boolean }) { diff --git a/apps/client/src/widgets/launch_bar/LauncherDefinitions.tsx b/apps/client/src/widgets/launch_bar/LauncherDefinitions.tsx index 91f8a794f..b905b561d 100644 --- a/apps/client/src/widgets/launch_bar/LauncherDefinitions.tsx +++ b/apps/client/src/widgets/launch_bar/LauncherDefinitions.tsx @@ -1,5 +1,5 @@ import { useContext, useEffect, useMemo, useState } from "preact/hooks"; -import { useLegacyWidget, useNoteContext, useNoteLabel, useNoteRelationTarget } from "../react/hooks"; +import { useLegacyWidget, useNoteContext, useNoteLabel, useNoteRelationTarget, useTriliumOptionBool } from "../react/hooks"; import { ParentComponent } from "../react/react_utils"; import BasicWidget from "../basic_widget"; import FNote from "../../entities/fnote"; @@ -70,6 +70,19 @@ export function ScriptLauncher({ launcherNote }: { launcherNote: FNote }) { ) } +export default function AiChatButton({ launcherNote }: { launcherNote: FNote }) { + const [ aiEnabled ] = useTriliumOptionBool("aiEnabled"); + const { icon, title } = useLauncherIconAndTitle(launcherNote); + + return aiEnabled && ( + + ) +} + export function TodayLauncher({ launcherNote }: { launcherNote: FNote }) { return (