feat: tags on tasks

This commit is contained in:
2025-04-25 15:20:20 +03:00
parent 320872ddc9
commit e8ded7f2ae
7 changed files with 203 additions and 48 deletions

View File

@@ -1,5 +1,4 @@
import { FunctionComponent } from "preact";
import { HTMLProps } from "preact/compat";
import { forwardRef, HTMLProps } from "preact/compat";
import { tv } from "tailwind-variants";
import classes from "./Button.module.scss";
const button = tv({
@@ -18,19 +17,14 @@ interface ButtonProps extends HTMLProps<HTMLButtonElement> {
className?: string;
}
const Button: FunctionComponent<ButtonProps> = ({
children,
onClick = () => {},
color = "primary",
className = "",
type = "button",
}) => {
const Button = forwardRef<HTMLButtonElement, ButtonProps>((props, ref) => {
const { children, onClick = () => {}, color = "primary", className = "", type = "button" } = props;
return (
<button type={type} class={button({ color: color, class: className })} onClick={onClick}>
<button ref={ref} type={type} class={button({ color: color, class: className })} onClick={onClick}>
{children}
</button>
);
};
});
Button.displayName = "AHButton";