Files
Trilium/apps/website/src/components/Button.tsx

24 lines
555 B
TypeScript
Raw Normal View History

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>
)
}