mirror of
https://github.com/theoleuthardt/werkzeugkiste.git
synced 2026-06-13 09:37:53 +00:00
feat: optimized button component for reusability
This commit is contained in:
parent
40032dca69
commit
aa40c16a21
1 changed files with 15 additions and 6 deletions
|
|
@ -1,19 +1,28 @@
|
|||
"use client";
|
||||
import React from "react";
|
||||
|
||||
interface ButtonProps {
|
||||
className?: string;
|
||||
content: string;
|
||||
onClick?: Function;
|
||||
onClick?: () => void;
|
||||
visible?: boolean;
|
||||
}
|
||||
|
||||
const Button = (props: ButtonProps) => {
|
||||
const Button = ({
|
||||
className,
|
||||
content,
|
||||
onClick,
|
||||
visible = true,
|
||||
}: ButtonProps) => {
|
||||
return (
|
||||
<button
|
||||
className={`p-3 border-2 border-white rounded-xl ` + props.className}
|
||||
onClick={() => props.onClick && props.onClick()}
|
||||
className={
|
||||
`p-3 border-2 border-white rounded-xl text-2xl hover:scale-110 hover:transition-scale hover:duration-200
|
||||
hover:text-blue-400 hover:border-blue-400 ` + className
|
||||
}
|
||||
onClick={() => onClick && onClick()}
|
||||
style={{ display: visible ? "block" : "none" }}
|
||||
>
|
||||
{props.content}
|
||||
{content}
|
||||
</button>
|
||||
);
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue