"use client"; // PEP-253: the secret name field with a live hint «это ключ <Сервис> — агенту лучше дать подключение». // The rules come from the server (`secretNameHints`), so no core code reaches the browser. import { useState } from "react"; import { Input } from "@/components/ui/input"; import { useT } from "@/components/I18n"; export function SecretNameHint({ hints, label }: { hints: Array<{ prefix: string; exact: boolean; service: string }>; label: string }) { const t = useT(); const [name, setName] = useState(""); const n = name.trim().toUpperCase(); const hit = n ? hints.find((h) => (h.exact ? n === h.prefix : n.startsWith(h.prefix))) : undefined; return (
{t("Это ключ {service} — агенту лучше дать подключение: он будет работать с сервисом, не видя ключа. Сохраните ключ здесь «только продукту» и нажмите «Сделать подключением».", { service: hit.service })}
)}