Fix fast refresh by abstracting project/link types into types.ts

This commit is contained in:
Xevion
2022-12-30 16:59:12 -06:00
parent 57e5ead20d
commit 130e6a0020
3 changed files with 29 additions and 28 deletions

View File

@@ -5,8 +5,8 @@ import DependentImage from "./DependentImage";
import ReactMarkdown from 'react-markdown'
import Link from "next/link";
import {LinkIcon, LinkIcons} from "../pages";
import {useRouter} from "next/router";
import {type LinkIcon, LinkIcons} from "../utils/types";
type ItemCardProps = {
banner: string;
@@ -70,7 +70,7 @@ const ItemCard = ({banner, bannerBlur, title, description, links, location}: Ite
{links!.map(({icon, location, newTab}) =>
<Link key={location} href={location} target={(newTab ?? true) ? "_blank" : "_self"}
onClick={e => e.stopPropagation()}>
{LinkIcons[icon]!({})}
{LinkIcons[icon]?.({})}
</Link>)}
</div>
</div> : null}