mirror of
https://github.com/zadam/trilium.git
synced 2026-03-22 16:23:50 +01:00
feat(mermaid): show switcher only when note is empty
This commit is contained in:
parent
da193b456b
commit
92f8459f28
@ -3,6 +3,7 @@ import "./NoteContentSwitcher.css";
|
||||
import FNote from "../../entities/fnote";
|
||||
import server from "../../services/server";
|
||||
import { Badge } from "../react/Badge";
|
||||
import { useNoteSavedData } from "../react/hooks";
|
||||
|
||||
export interface NoteContentTemplate {
|
||||
name: string;
|
||||
@ -15,7 +16,9 @@ interface NoteContentSwitcherProps {
|
||||
}
|
||||
|
||||
export default function NoteContentSwitcher({ note, templates }: NoteContentSwitcherProps) {
|
||||
return (
|
||||
const blob = useNoteSavedData(note?.noteId);
|
||||
|
||||
return (blob?.length === 0 &&
|
||||
<div className="note-content-switcher">
|
||||
{templates.map(sample => (
|
||||
<Badge
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user