2022-12-13 23:50:13 +01:00
|
|
|
import { Icon, Icons } from "@/components/Icon";
|
2022-02-18 14:36:32 +01:00
|
|
|
|
|
|
|
export interface IconPatchProps {
|
|
|
|
active?: boolean;
|
|
|
|
onClick?: () => void;
|
|
|
|
clickable?: boolean;
|
|
|
|
className?: string;
|
|
|
|
icon: Icons;
|
2023-01-19 22:29:56 +01:00
|
|
|
transparent?: boolean;
|
2022-02-18 14:36:32 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
export function IconPatch(props: IconPatchProps) {
|
2023-01-19 22:29:56 +01:00
|
|
|
const clickableClasses = props.clickable
|
|
|
|
? "cursor-pointer hover:scale-110 hover:bg-denim-600 hover:text-white active:scale-125"
|
|
|
|
: "";
|
|
|
|
const transparentClasses = props.transparent
|
|
|
|
? "bg-opacity-0 hover:bg-opacity-50"
|
|
|
|
: "";
|
|
|
|
const activeClasses = props.active
|
|
|
|
? "border-bink-600 bg-bink-100 text-bink-600"
|
|
|
|
: "";
|
|
|
|
|
2022-02-18 14:36:32 +01:00
|
|
|
return (
|
|
|
|
<div className={props.className || undefined} onClick={props.onClick}>
|
|
|
|
<div
|
2023-09-06 20:27:17 +02:00
|
|
|
className={`flex h-12 w-12 items-center justify-center rounded-full border-2 border-transparent bg-pill-background transition-[background-color,color,transform,border-color] duration-75 ${transparentClasses} ${clickableClasses} ${activeClasses}`}
|
2022-02-18 14:36:32 +01:00
|
|
|
>
|
|
|
|
<Icon icon={props.icon} />
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|