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

22 lines
584 B
TypeScript
Raw Normal View History

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-25 09:17:34 -05:00
<div className="hover:bg-gray-50 hover:outline outline-sky-100 outline-1 duration-100 rounded-md my-1 p-2 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>
);
}