mirror of
https://github.com/hazemKrimi/crimson-quirks-ui.git
synced 2026-05-02 02:30:29 +00:00
35 lines
727 B
TypeScript
35 lines
727 B
TypeScript
import { Link as RouterLink } from 'react-router-dom';
|
|
import { Wrapper } from './styles';
|
|
|
|
type LinkProps = {
|
|
href: string;
|
|
children?: React.ReactNode | JSX.Element | string;
|
|
color?:
|
|
| 'client'
|
|
| 'productOwner'
|
|
| 'developer'
|
|
| 'admin'
|
|
| 'success'
|
|
| 'warning'
|
|
| 'error'
|
|
| 'black'
|
|
| 'white'
|
|
| string;
|
|
className?: string;
|
|
iconLeft?: React.SVGProps<SVGSVGElement>;
|
|
onClick?: () => void;
|
|
};
|
|
|
|
const Link = ({ href, children, iconLeft, ...props }: LinkProps) => {
|
|
return (
|
|
<Wrapper {...props}>
|
|
<RouterLink to={href}>
|
|
{iconLeft && <span className='icon left'>{iconLeft}</span>}
|
|
{children}
|
|
</RouterLink>
|
|
</Wrapper>
|
|
);
|
|
};
|
|
|
|
export default Link;
|