mirror of
https://github.com/movie-web/movie-web.git
synced 2024-11-15 10:25:07 +01:00
28 lines
559 B
TypeScript
28 lines
559 B
TypeScript
|
import { Icon, Icons } from "@/components/Icon";
|
||
|
import { ReactNode } from "react";
|
||
|
|
||
|
interface Props {
|
||
|
icon?: Icons;
|
||
|
onClick?: () => void;
|
||
|
children?: ReactNode;
|
||
|
}
|
||
|
|
||
|
// TODO style button
|
||
|
// TODO transition modal
|
||
|
export function Button(props: Props) {
|
||
|
return (
|
||
|
<button
|
||
|
type="button"
|
||
|
onClick={props.onClick}
|
||
|
className="inline-flex items-center justify-center"
|
||
|
>
|
||
|
{props.icon ? (
|
||
|
<span className="mr-3">
|
||
|
<Icon icon={props.icon} />
|
||
|
</span>
|
||
|
) : null}
|
||
|
{props.children}
|
||
|
</button>
|
||
|
);
|
||
|
}
|