chs/src-web/components/Button.tsx

24 lines
554 B
TypeScript

import { children, Component, JSX } from "solid-js";
import './Button.css';
interface Props {
onClick?: () => void;
children: JSX.Element;
}
const Button: Component<Props> = (props) => {
const c = children(() => props.children)
return <button class="button" onClick={props.onClick}>
{c()}
</button>
}
export default Button;
export const ButtonContainer: Component<{ children: JSX.Element }> = (props) => {
const c = children(() => props.children);
return <div class="button-container">
{c()}
</div>
}