import { Button, Input } from "antd"; import { useEffect, useState } from "react"; import { confirmDialog, toast } from "../../dialogs"; import { useT } from "../../i18n"; import { loadTemplates, placeholders, saveTemplates, type Template, type TemplateLists } from "../../templates"; import { Icon } from "../Icon"; function List({ scope, initial }: { scope: "personal" | "global"; initial: Template[] }) { const t = useT(); const [list, setList] = useState(initial); const [dirty, setDirty] = useState(false); const set = (i: number, patch: Partial