Many improvements.

This commit is contained in:
Daniel
2023-03-06 00:33:20 +03:30
parent f3e104aafe
commit cff10fa9b6
19 changed files with 314 additions and 79 deletions
+10 -15
View File
@@ -1,26 +1,21 @@
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { Collection } from "@prisma/client";
import { IconProp } from "@fortawesome/fontawesome-svg-core";
import { MouseEventHandler } from "react";
interface TextObject {
name: string;
}
import Link from "next/link";
interface SidebarItemProps {
item: Collection | TextObject;
text: string;
icon: IconProp;
onClick?: MouseEventHandler;
path: string;
}
export default function ({ item, icon, onClick }: SidebarItemProps) {
export default function ({ text, icon, path }: SidebarItemProps) {
return (
<div
onClick={onClick}
className="hover:bg-gray-50 duration-100 text-sky-900 rounded my-1 p-3 cursor-pointer flex items-center gap-2"
>
<FontAwesomeIcon icon={icon} className="w-4 text-sky-300" />
<p>{item.name}</p>
</div>
<Link href={path}>
<div className="hover:bg-gray-50 duration-100 text-sky-900 rounded my-1 p-3 cursor-pointer flex items-center gap-2">
<FontAwesomeIcon icon={icon} className="w-4 text-sky-300" />
<p>{text}</p>
</div>
</Link>
);
}