import { useEffect, useState } from "preact/hooks"; import { LANG, t } from "../../i18n"; import { api, apiErrorText } from "../../features/customize/api"; import { custTab } from "../../features/customize/actions"; import { nestedEditor } from "../../features/customize/state"; import { skillReadinessNoteText } from "../../features/customize/environment"; import { asList, asString, confirmAction, dropSkillsCatalog, hint, } from "../../features/customize/host"; import { scheduleTimeout } from "../../features/customize/timers"; import { useAlive, useTimerLease } from "./use-timer-lease"; import { Icon } from "./icons"; function skillVersionPath(name: string, scope: string, projectId: string | null): string { const encodedName = encodeURIComponent(name); if (scope === "project") { if (!projectId) throw new Error("project scope is unavailable"); return `/projects/${encodeURIComponent(projectId)}/skills/${encodedName}`; } return `/skills/${encodedName}`; } export function NestedEditor() { const editor = nestedEditor.value; if (!editor) return null; return (
{text};
}