import React, { useEffect, useState } from "react"; import { Notice } from "obsidian"; import { PluginSettings } from "@/types/pluginSettings"; import { TemplateSettings } from "./TemplateSettings"; import { BehaviourSettings } from "./BehaviourSettings"; import { CustomStatusSettings } from "./CustomStatusSettings"; import { QuickCommandsSettings } from "./QuickCommandsSettings"; import { SynchronizationSettings } from "./SynchronizationSettings"; import { EditorToolbarSettings, ExperimentalSettings, FileExplorerSettings, StatusBarSettings, UnknownStatusAppearanceSettings, } from "./UISettings"; export type Props = { settings: PluginSettings; onChange: (key: keyof PluginSettings, value: unknown) => void; }; type SectionId = | "templates-statuses" | "quick-actions" | "status-bar" | "editor-toolbar" | "file-explorer" | "unknown-appearance" | "behavior-storage" | "synchronization" | "experimental-features"; type SectionDefinition = { id: SectionId; label: string; description: string; content: React.ReactNode; }; const SettingsUI: React.FC = ({ settings, onChange }) => { const [localSettings, setLocalSettings] = useState(settings); const [expandedSections, setExpandedSections] = useState< Partial> >({}); useEffect(() => { setLocalSettings(settings); }, [settings]); const handleChange = (key: keyof PluginSettings, value: unknown) => { setLocalSettings((prev) => ({ ...prev, [key]: value })); onChange(key, value); }; const handleSupportClick = (url: string, label: string) => { window.open(url); navigator.clipboard.writeText(url).then(() => { new Notice(`Copied ${label} URL to clipboard!`); }); }; const sections: SectionDefinition[] = [ { id: "templates-statuses", label: "Templates & Statuses", description: "Enable predefined workflows or define your own statuses.", content: (
), }, { id: "quick-actions", label: "Quick Actions", description: "Choose statuses with command palette shortcuts.", content: ( ), }, { id: "status-bar", label: "Status Bar", description: "Icon, popup, badge style/content, and no-status behavior.", content: ( ), }, { id: "editor-toolbar", label: "Editor Toolbar", description: "Button placement and visibility across panes.", content: ( ), }, { id: "file-explorer", label: "File Explorer", description: "Icon placement, hiding unknown, and visual styling options.", content: ( ), }, { id: "unknown-appearance", label: "Unknown / No-Status Appearance", description: "Fallback icon and color when a note lacks status.", content: ( ), }, { id: "behavior-storage", label: "Behavior & Storage", description: "Multi-status mode, tag key, mappings, and vault safeguards.", content: ( ), }, { id: "synchronization", label: "Synchronization", description: "Keep custom statuses and templates in sync across multiple devices.", content: ( ), }, { id: "experimental-features", label: "Experimental Features", description: "Opt into dashboard and grouped view previews.", content: ( ), }, ]; return (
{sections.map((section) => { const isOpen = expandedSections[section.id] ?? false; return (
{isOpen ? (
{section.content}
) : null}
); })}

Note Status keeps your vault aligned with clear, configurable workflows. Tune the sections below to match how you review notes, surface statuses, and keep storage tidy.

); }; export default SettingsUI;