mirror of
https://github.com/zadam/trilium.git
synced 2025-12-22 08:09:55 +01:00
chore(react/ribbon): port revisions button
This commit is contained in:
28
apps/client/src/widgets/ribbon/NoteActions.tsx
Normal file
28
apps/client/src/widgets/ribbon/NoteActions.tsx
Normal file
@@ -0,0 +1,28 @@
|
||||
import FNote from "../../entities/fnote"
|
||||
import { t } from "../../services/i18n"
|
||||
import ActionButton from "../react/ActionButton"
|
||||
|
||||
interface NoteActionsProps {
|
||||
note?: FNote;
|
||||
}
|
||||
|
||||
export default function NoteActions(props: NoteActionsProps) {
|
||||
return (
|
||||
<>
|
||||
<RevisionsButton {...props} />
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
function RevisionsButton({ note }: NoteActionsProps) {
|
||||
const isEnabled = !["launcher", "doc"].includes(note?.type ?? "");
|
||||
|
||||
return (isEnabled &&
|
||||
<ActionButton
|
||||
icon="bx bx-history"
|
||||
text={t("revisions_button.note_revisions")}
|
||||
triggerCommand="showRevisions"
|
||||
titlePosition="bottom"
|
||||
/>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user