import "./BreadcrumbBadges.css";
import { ComponentChildren } from "preact";
import { useIsNoteReadOnly, useNoteContext } from "./react/hooks";
export default function NoteBadges() {
return (
);
}
function ReadOnlyBadge() {
const { note, noteContext } = useNoteContext();
const { isReadOnly, enableEditing } = useIsNoteReadOnly(note, noteContext);
const isExplicitReadOnly = note?.isLabelTruthy("readOnly");
return (isReadOnly &&
enableEditing()}>
{isExplicitReadOnly ? "Read-only" : "Auto read-only"}
);
}
function Badge({ children, onClick }: { children: ComponentChildren, onClick?: () => void }) {
return (
{children}
);
}