import * as React from "react"; import type { BotConfig } from "../api/bot_config"; import { botConfigApi } from "../api/bot_config"; const { useState, useEffect } = React; interface BotConfigPageProps { onBack: () => void; } const fieldStyle: React.CSSProperties = { display: "flex", flexDirection: "column", gap: "4px", }; const labelStyle: React.CSSProperties = { fontSize: "0.8em", color: "#aaa", fontWeight: 500, }; const inputStyle: React.CSSProperties = { padding: "8px 10px", borderRadius: "6px", border: "1px solid #333", background: "#1e1e1e", color: "#ececec", fontSize: "0.9em", fontFamily: "monospace", outline: "none", }; const sectionStyle: React.CSSProperties = { background: "#1e1e1e", border: "1px solid #333", borderRadius: "8px", padding: "20px", display: "flex", flexDirection: "column", gap: "14px", }; const sectionTitleStyle: React.CSSProperties = { fontSize: "0.85em", fontWeight: 600, color: "#aaa", textTransform: "uppercase", letterSpacing: "0.06em", marginBottom: "2px", }; function Field({ label, value, onChange, placeholder, type = "text", }: { label: string; value: string; onChange: (v: string) => void; placeholder?: string; type?: string; }) { return (
onChange(e.target.value)} placeholder={placeholder} style={inputStyle} autoComplete="off" />
); } function ListField({ label, value, onChange, placeholder, }: { label: string; value: string[]; onChange: (v: string[]) => void; placeholder?: string; }) { return (