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

23 lines
647 B
TypeScript
Raw Normal View History

import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
2023-03-05 15:03:20 -06:00
import Link from "next/link";
2023-03-22 22:06:15 -05:00
import React, { ReactElement } from "react";
interface SidebarItemProps {
2023-03-05 15:03:20 -06:00
text: string;
2023-03-22 22:06:15 -05:00
icon: ReactElement;
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 23:10:10 -06:00
<div className="hover:bg-gray-50 hover:outline outline-sky-100 outline-1 duration-100 rounded my-1 p-3 cursor-pointer flex items-center gap-2">
2023-03-22 22:06:15 -05:00
{React.cloneElement(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>
);
}