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 { ArrowUpRightIcon } from '@heroicons/react/24/solid' ;
2+ import classNames from 'classnames' ;
23import type {
34 AnchorHTMLAttributes ,
45 ButtonHTMLAttributes ,
@@ -12,10 +13,12 @@ type LinkWithArrowProps =
1213 | ( { href : string } & AnchorHTMLAttributes < HTMLAnchorElement > )
1314 | ( Omit < ButtonHTMLAttributes < HTMLButtonElement > , 'type' > & { href ?: never } ) ;
1415
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 ) {
1922 return (
2023 < Link
2124 { ...( rest as AnchorHTMLAttributes < HTMLAnchorElement > ) }
@@ -33,7 +36,10 @@ const LinkWithArrow: FC<PropsWithChildren<LinkWithArrowProps>> = props => {
3336 < button
3437 type = "button"
3538 { ...( 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+ ) }
3743 >
3844 < span >
3945 { children }
You can’t perform that action at this time.
0 commit comments