mirror of
https://github.com/zadam/trilium.git
synced 2025-12-20 07:09:54 +01:00
client/status bar/note paths: replace the "Clone note to new location" button with a link
This commit is contained in:
@@ -1,16 +1,20 @@
|
||||
import { ComponentChild } from "preact";
|
||||
import { CommandNames } from "../../components/app_context";
|
||||
|
||||
interface LinkButtonProps {
|
||||
onClick: () => void;
|
||||
onClick?: () => void;
|
||||
text: ComponentChild;
|
||||
triggerCommand?: CommandNames;
|
||||
}
|
||||
|
||||
export default function LinkButton({ onClick, text }: LinkButtonProps) {
|
||||
export default function LinkButton({ onClick, text, triggerCommand }: LinkButtonProps) {
|
||||
return (
|
||||
<a class="tn-link" href="javascript:" onClick={(e) => {
|
||||
e.preventDefault();
|
||||
onClick();
|
||||
}}>
|
||||
<a class="tn-link" href="javascript:"
|
||||
data-trigger-command={triggerCommand}
|
||||
onClick={(e) => {
|
||||
e.preventDefault();
|
||||
if (onClick) onClick();
|
||||
}}>
|
||||
{text}
|
||||
</a>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user