el.xwx.moe/components/Sidebar/SidebarItem.tsx

22 lines
643 B
TypeScript
Raw Normal View History

import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { IconProp } from "@fortawesome/fontawesome-svg-core";
import { MouseEventHandler } from "react";
2023-03-05 15:03:20 -06:00
import Link from "next/link";
interface SidebarItemProps {
2023-03-05 15:03:20 -06:00
text: string;
icon: IconProp;
2023-03-05 15:03:20 -06:00
path: string;
}
2023-03-05 15:03:20 -06:00
export default function ({ text, icon, path }: SidebarItemProps) {
return (
2023-03-05 15:03:20 -06:00
<Link href={path}>
2023-03-10 13:25:33 -06:00
<div className="hover:bg-gray-50 duration-100 rounded my-1 p-3 cursor-pointer flex items-center gap-2">
2023-03-05 15:03:20 -06:00
<FontAwesomeIcon icon={icon} className="w-4 text-sky-300" />
2023-03-10 13:25:33 -06:00
<p className="text-sky-900">{text}</p>
2023-03-05 15:03:20 -06:00
</div>
</Link>
);
}