File tree Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change 1
1
import { ArrowUpRightIcon } from '@heroicons/react/24/solid' ;
2
+ import classNames from 'classnames' ;
2
3
import type {
3
4
AnchorHTMLAttributes ,
4
5
ButtonHTMLAttributes ,
@@ -12,10 +13,12 @@ type LinkWithArrowProps =
12
13
| ( { href : string } & AnchorHTMLAttributes < HTMLAnchorElement > )
13
14
| ( Omit < ButtonHTMLAttributes < HTMLButtonElement > , 'type' > & { href ?: never } ) ;
14
15
15
- const LinkWithArrow : FC < PropsWithChildren < LinkWithArrowProps > > = props => {
16
- const { children, className, ...rest } = props ;
17
-
18
- if ( 'href' in props && props . href ) {
16
+ const LinkWithArrow : FC < PropsWithChildren < LinkWithArrowProps > > = ( {
17
+ children,
18
+ className,
19
+ ...rest
20
+ } ) => {
21
+ if ( rest . href ) {
19
22
return (
20
23
< Link
21
24
{ ...( rest as AnchorHTMLAttributes < HTMLAnchorElement > ) }
@@ -33,7 +36,10 @@ const LinkWithArrow: FC<PropsWithChildren<LinkWithArrowProps>> = props => {
33
36
< button
34
37
type = "button"
35
38
{ ...( rest as ButtonHTMLAttributes < HTMLButtonElement > ) }
36
- className = { `${ className || '' } text-green-600 hover:text-green-900 dark:text-green-400 dark:hover:text-green-200` }
39
+ className = { classNames (
40
+ className ,
41
+ 'text-green-600 hover:text-green-900 dark:text-green-400 dark:hover:text-green-200'
42
+ ) }
37
43
>
38
44
< span >
39
45
{ children }
You can’t perform that action at this time.
0 commit comments