mirror of
https://github.com/BlowaterNostr/blowater.git
synced 2024-10-18 15:43:20 +00:00
30 lines
962 B
TypeScript
30 lines
962 B
TypeScript
/** @jsx h */
|
|
import { ComponentChildren, h } from "https://esm.sh/preact@10.17.1";
|
|
import { tw } from "https://esm.sh/twind@0.16.16";
|
|
import { DividerBackgroundColor, HoverButtonBackgroudColor } from "../style/colors.ts";
|
|
|
|
export function ButtonGroup(props: {
|
|
children: ComponentChildren;
|
|
class?: string;
|
|
style?: string | h.JSX.CSSProperties | h.JSX.SignalLike<string | h.JSX.CSSProperties>;
|
|
}) {
|
|
return (
|
|
<div
|
|
style={props.style}
|
|
class={[
|
|
tw`flex w-min bg-[${DividerBackgroundColor}]
|
|
rounded
|
|
children:hover:bg-[${HoverButtonBackgroudColor}]
|
|
children:focus:outline-none
|
|
focus-visible:outline-none
|
|
children:px-2 children:py-1
|
|
firstChild:rounded-l
|
|
lastChild:rounded-r`,
|
|
props.class,
|
|
].join(" ")}
|
|
>
|
|
{props.children}
|
|
</div>
|
|
);
|
|
}
|