File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import React from 'react' ;
22
3- interface ButtonProps extends React . ButtonHTMLAttributes < HTMLButtonElement > {
4- children : React . ReactNode ;
5- name : string ;
6- }
3+ type ButtonProps = React . ComponentProps < typeof Button > ;
74
8- const Button : React . FC < ButtonProps > = ( { children, name, ...props } ) => {
5+ const Button : React . FC < ButtonProps > = ( { children, ...props } ) => {
6+ console . log ( props ) ;
97 return (
10- < >
11- < button
12- type = "button"
13- name = { name }
14- { ...props }
15- className = "p-4 px-8 text-white font-bold bg-red-600 rounded"
16- style = { {
17- display : 'block' ,
18- width : '200px' ,
19- overflow : 'hidden' ,
20- whiteSpace : 'nowrap' ,
21- textOverflow : 'ellipsis' ,
22- textAlign : 'center' ,
23- } }
24- >
25- { children }
26- </ button >
27- </ >
8+ < button
9+ type = "button"
10+ className = "p-4 px-8 text-white font-bold bg-red-600 rounded block w-[200px] overflow-hidden whitespace-nowrap overflow-ellipsis text-center"
11+ { ...props }
12+ >
13+ { children }
14+ </ button >
2815 ) ;
2916} ;
3017
Original file line number Diff line number Diff line change 11import React from 'react' ;
22
3- interface LinkProps extends React . HTMLProps < HTMLAnchorElement > {
4- children : React . ReactNode ;
5- to : string ;
6- }
3+ type LinkButtonProps = React . Component < 'a' > ;
74
8- const LinkButton : React . FC < LinkProps > = ( { to , children, ...props } ) => {
5+ const LinkButton : React . FC < LinkButtonProps > = ( { children, ...props } ) => {
96 return (
10- < >
11- < a
12- href = { to }
13- { ...props }
14- className = "p-2"
15- style = { {
16- width : '100px' ,
17- overflow : 'hidden' ,
18- whiteSpace : 'nowrap' ,
19- textOverflow : 'ellipsis' ,
20- textAlign : 'center' ,
21- } }
22- >
23- { children }
24- </ a >
25- </ >
7+ < a
8+ className = "p-4 px-8 text-white font-bold bg-red-600 rounded block w-[200px] overflow-hidden whitespace-nowrap overflow-ellipsis text-center"
9+ { ...props }
10+ >
11+ { children }
12+ </ a >
2613 ) ;
2714} ;
2815
You can’t perform that action at this time.
0 commit comments