mirror of
https://github.com/zadam/trilium.git
synced 2025-11-03 11:56:01 +01:00
27 lines
734 B
TypeScript
27 lines
734 B
TypeScript
import { ComponentChildren } from "preact";
|
|
import Icon from "./Icon";
|
|
import "./Button.css";
|
|
|
|
interface ButtonProps {
|
|
href?: string;
|
|
iconSvg?: string;
|
|
text: ComponentChildren;
|
|
openExternally?: boolean;
|
|
className?: string;
|
|
outline?: boolean;
|
|
}
|
|
|
|
export default function Button({ href, iconSvg, openExternally, text, className, outline }: ButtonProps) {
|
|
return (
|
|
<a
|
|
className={`button ${className} ${outline ? "outline" : ""}`}
|
|
href={href}
|
|
target={openExternally ? "_blank" : undefined}
|
|
rel={openExternally ? "noopener noreferrer" : undefined}
|
|
>
|
|
{iconSvg && <><Icon svg={iconSvg} />{" "}</>}
|
|
{text}
|
|
</a>
|
|
)
|
|
}
|