// PEP-23: project autonomy in «⋯ Настройки проекта» — preset levels and the individual settings. import { AUTONOMY_LEVEL_HINT, AUTONOMY_LEVEL_RU, AUTONOMY_LEVELS, autonomyLevel, type AutonomyLevel, type AutonomySettings } from "@peppa/core"; import { setAutonomyAction } from "@/app/(app)/actions"; import { Hidden } from "@/components/cards"; import { Button } from "@/components/ui/button"; import { Input, Label, NativeSelect } from "@/components/ui/input"; import { getT } from "@/lib/i18n"; export async function AutonomyPanel({ projectId, settings, back, engineer = false }: { projectId: number; settings: AutonomySettings; back: string; /** PEP-123: the detailed settings speak of merges and pipelines — «Инженер» only. */ engineer?: boolean }) { const t = await getT(); const current = autonomyLevel(settings); const s = settings; return (
{(Object.keys(AUTONOMY_LEVELS) as AutonomyLevel[]).map((level) => (
))} {current === "custom" && ( )}

{current === "custom" ? t("Своя комбинация настроек ниже.") : t.text(AUTONOMY_LEVEL_HINT[current])}

{engineer && (
{t("Настроить подробно")}
{t("с")} {t("до")}
)} {engineer &&

{t("PR, меняющий конвейер (.gitea/, checks, deploy), сам не мержится и не закрывается — его принимает PM.")}

}
); }