2023-02-19 18:36:53 +01:00
|
|
|
import { ReactNode } from "react";
|
|
|
|
|
2023-04-24 17:41:54 +02:00
|
|
|
import { Icon, Icons } from "@/components/Icon";
|
|
|
|
|
2023-02-19 18:36:53 +01:00
|
|
|
interface Props {
|
|
|
|
icon?: Icons;
|
|
|
|
onClick?: () => void;
|
|
|
|
children?: ReactNode;
|
|
|
|
}
|
|
|
|
|
|
|
|
export function Button(props: Props) {
|
|
|
|
return (
|
|
|
|
<button
|
|
|
|
type="button"
|
|
|
|
onClick={props.onClick}
|
2023-10-18 21:18:47 +02:00
|
|
|
className="inline-flex items-center justify-center rounded-lg bg-white px-4 py-3 font-bold text-black transition-[transform,background-color] duration-100 hover:bg-gray-200 active:scale-105 md:px-8"
|
2023-02-19 18:36:53 +01:00
|
|
|
>
|
|
|
|
{props.icon ? (
|
2023-02-19 19:54:34 +01:00
|
|
|
<span className="mr-3 hidden md:inline-block">
|
2023-02-19 18:36:53 +01:00
|
|
|
<Icon icon={props.icon} />
|
|
|
|
</span>
|
|
|
|
) : null}
|
|
|
|
{props.children}
|
|
|
|
</button>
|
|
|
|
);
|
|
|
|
}
|