mirror of
https://github.com/SomboChea/ui
synced 2024-09-29 21:07:47 +07:00
16 lines
316 B
TypeScript
16 lines
316 B
TypeScript
|
import React, { ReactNode } from 'react';
|
||
|
|
||
|
interface Props {
|
||
|
children?: ReactNode;
|
||
|
to: string;
|
||
|
blank?: boolean;
|
||
|
}
|
||
|
|
||
|
const Link: React.FC<Props> = ({ children, to = '#', blank = false, ...props }) => (
|
||
|
<a href={to} target={blank ? '_blank' : '_self'} {...props}>
|
||
|
{children}
|
||
|
</a>
|
||
|
);
|
||
|
|
||
|
export default Link;
|