mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-08-17 15:29:44 +02:00

* renamed folder MainMenu -> main-menu * rename ariaLabel -> aria-label and dataTestId -> data-testid * allow rest props * fix * lint * add ts check * ts for div * fix * fix * fix
36 lines
842 B
TypeScript
36 lines
842 B
TypeScript
import MenuItemContent from "./DropdownMenuItemContent";
|
|
import React from "react";
|
|
import { getDrodownMenuItemClassName } from "./DropdownMenuItem";
|
|
const DropdownMenuItemLink = ({
|
|
icon,
|
|
shortcut,
|
|
href,
|
|
children,
|
|
className = "",
|
|
...rest
|
|
}: {
|
|
icon?: JSX.Element;
|
|
children: React.ReactNode;
|
|
shortcut?: string;
|
|
className?: string;
|
|
href: string;
|
|
} & React.AnchorHTMLAttributes<HTMLAnchorElement>) => {
|
|
return (
|
|
<a
|
|
{...rest}
|
|
href={href}
|
|
target="_blank"
|
|
rel="noreferrer"
|
|
className={getDrodownMenuItemClassName(className)}
|
|
title={rest.title ?? rest["aria-label"]}
|
|
>
|
|
<MenuItemContent icon={icon} shortcut={shortcut}>
|
|
{children}
|
|
</MenuItemContent>
|
|
</a>
|
|
);
|
|
};
|
|
|
|
export default DropdownMenuItemLink;
|
|
DropdownMenuItemLink.displayName = "DropdownMenuItemLink";
|