mirror of
https://github.com/Sonny93/my-links.git
synced 2025-12-09 15:05:35 +00:00
feat: update default layout
This commit is contained in:
26
inertia/components/common/links/external_link_unstyled.tsx
Normal file
26
inertia/components/common/links/external_link_unstyled.tsx
Normal file
@@ -0,0 +1,26 @@
|
||||
import { Anchor, CSSProperties } from '@mantine/core';
|
||||
import { AnchorHTMLAttributes, ReactNode } from 'react';
|
||||
|
||||
interface ExternalLinkUnstyledProps
|
||||
extends AnchorHTMLAttributes<HTMLAnchorElement> {
|
||||
children: ReactNode;
|
||||
style?: CSSProperties;
|
||||
title?: string;
|
||||
className?: string;
|
||||
newTab?: boolean;
|
||||
}
|
||||
export const ExternalLinkUnstyled = ({
|
||||
children,
|
||||
newTab = true,
|
||||
...props
|
||||
}: ExternalLinkUnstyledProps) => (
|
||||
<Anchor
|
||||
component="a"
|
||||
target={newTab ? '_blank' : undefined}
|
||||
rel="noreferrer"
|
||||
{...props}
|
||||
style={{ ...props.style, textDecoration: 'none' }}
|
||||
>
|
||||
{children}
|
||||
</Anchor>
|
||||
);
|
||||
Reference in New Issue
Block a user