Files
Trilium/apps/client/src/widgets/react/LinkButton.tsx

21 lines
556 B
TypeScript
Raw Normal View History

import { ComponentChild } from "preact";
import { CommandNames } from "../../components/app_context";
interface LinkButtonProps {
onClick?: () => void;
text: ComponentChild;
triggerCommand?: CommandNames;
}
export default function LinkButton({ onClick, text, triggerCommand }: LinkButtonProps) {
return (
<a class="tn-link" href="#"
data-trigger-command={triggerCommand}
onClick={(e) => {
e.preventDefault();
onClick?.();
}}>
{text}
</a>
)
}