Files
umami/src/components/common/LinkButton.tsx
T
2025-05-03 00:31:37 -07:00

32 lines
625 B
TypeScript

import { ReactNode } from 'react';
import Link from 'next/link';
import { Button } from '@umami/react-zen';
import { useLocale } from '@/components/hooks';
export interface LinkButtonProps {
href: string;
target?: string;
scroll?: boolean;
variant?: any;
children?: ReactNode;
}
export function LinkButton({
href,
variant,
scroll = true,
target,
children,
...props
}: LinkButtonProps) {
const { dir } = useLocale();
return (
<Button {...props} variant={variant} asChild>
<Link href={href} dir={dir} scroll={scroll} target={target}>
{children}
</Link>
</Button>
);
}