diff --git a/interface/src/pages/Shortcuts.tsx b/interface/src/pages/Shortcuts.tsx index 5cdaf795..ef5b1d6a 100644 --- a/interface/src/pages/Shortcuts.tsx +++ b/interface/src/pages/Shortcuts.tsx @@ -2,12 +2,7 @@ import { useState } from "react"; import Switch from "../components/Switch"; import { useSettingsContext } from "../SettingsContext"; import { motion, AnimatePresence } from "framer-motion"; - -interface Shortcut { - name: string; - url: string; - enabled?: boolean; -} +import { CustomShortcut } from "../types/AppProps"; export default function Shortcuts() { const { settingsState, setSettingsState } = useSettingsContext(); @@ -35,7 +30,7 @@ export default function Shortcuts() { const addNewCustomShortcut = (): void => { if (isValidTitle(newTitle) && isValidURL(newURL)) { - const newShortcut: Shortcut = { name: newTitle.trim(), url: newURL.trim() }; + const newShortcut: CustomShortcut = { name: newTitle.trim(), url: newURL.trim(), icon: newTitle[0] }; const updatedCustomShortcuts = [...settingsState.customshortcuts, newShortcut]; setSettingsState({ ...settingsState, customshortcuts: updatedCustomShortcuts }); setNewTitle(""); @@ -118,8 +113,8 @@ export default function Shortcuts() { {/* Shortcuts Section */} {settingsState.shortcuts ? ( - settingsState.shortcuts.map((shortcut) => shortcut.name && ( -