File tree Expand file tree Collapse file tree 1 file changed +30
-3
lines changed
Expand file tree Collapse file tree 1 file changed +30
-3
lines changed Original file line number Diff line number Diff line change 11"use client" ;
22
3+ import clsx from "clsx" ;
4+
35interface ButtonProps {
4- children ?: string ;
6+ children : React . ReactNode ;
7+ size ?: "small" | "medium" | "large" ;
8+ backColor ?: string ;
9+ textColor ?: string ;
10+ borderColor ?: string ;
511}
612
7- const Button = ( { children } : ButtonProps ) => {
8- return < div > { children } </ div > ;
13+ const Button = ( {
14+ children,
15+ size,
16+ backColor,
17+ textColor,
18+ borderColor,
19+ } : ButtonProps ) => {
20+ return (
21+ < div
22+ className = { clsx (
23+ "flex items-center justify-center rounded-lg cursor-pointer hover:bg-blue-500" ,
24+ {
25+ "px-4 py-2 text-b2" : size === "small" ,
26+ "px-6 py-3 text-b2" : size === "medium" ,
27+ "w-[27rem] h-[3rem] text-b2" : size === "large" ,
28+ } ,
29+ { "bg-blue-600 text-white" : backColor === "blue" } ,
30+ { "border border-blue-600" : borderColor === "blue" } ,
31+ ) }
32+ >
33+ { children }
34+ </ div >
35+ ) ;
936} ;
1037
1138export default Button ;
You can’t perform that action at this time.
0 commit comments