Files
vf_react/boilerplate-chakra-pro-main/components/link/LinkButton.tsx
2025-11-22 11:41:56 +08:00

21 lines
442 B
TypeScript

'use client';
import Link, { LinkProps } from 'next/link';
import { Button, ButtonProps } from '@chakra-ui/react';
type ChakraAndNextProps = ButtonProps & LinkProps;
export default function LinkButton({
href,
children,
prefetch = true,
...props
}: ChakraAndNextProps) {
return (
<Link href={href} passHref prefetch={prefetch}>
<Button as="a" variant="a" {...props}>
{children}
</Button>
</Link>
);
}