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