client/status bar/note paths: replace the "Clone note to new location" button with a link

This commit is contained in:
Adorian Doran
2025-12-15 00:31:36 +02:00
parent 8fa6e38382
commit d1ae2db587
2 changed files with 14 additions and 9 deletions

View File

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