import classNames from "classnames"; import { useEffect, useState } from "react"; import { Link } from "react-router-dom"; import { absolutifyLink } from "../helpers/utils"; import useFaviconStore from "../stores/v1/favicon"; import Icon from "./Icon"; import ShortcutActionsDropdown from "./ShortcutActionsDropdown"; interface Props { shortcut: Shortcut; } const ShortcutView = (props: Props) => { const { shortcut } = props; const faviconStore = useFaviconStore(); const [favicon, setFavicon] = useState(undefined); const shortcutLink = absolutifyLink(`/s/${shortcut.name}`); useEffect(() => { faviconStore.getOrFetchUrlFavicon(shortcut.link).then((url) => { if (url) { setFavicon(url); } }); }, [shortcut.link]); return ( <>
{favicon ? ( ) : ( )}
); }; export default ShortcutView;