The Report Explainer analyzes any report tab from the Reports dashboard. Switch to a report tab, copy the data, and paste it here for an AI-generated breakdown.
setDateRange(e.target.value)}
placeholder="e.g., Last 7 days, March 2026"
className={inputBaseClass}
style={inputStyle}
/>
AI-generated suggestions — review before use. Not a substitute for business judgment.
);
}
// ── Main Page ─────────────────────────────────────────────────────────────────
export default function AIsettingsClient({
isConnected,
brandId,
brandName,
provider = "openai",
model = "gpt-4o-mini",
customEndpoint
}: Props) {
const [activeTool, setActiveTool] = useState(null);
const [activeModule, setActiveModule] = useState(null);
// selectedProvider/currentModel are derived directly from props. We use a
// `key` on the child components so any prop change fully remounts them and
// their internal useState(initialProp) re-initializes — no stale copy.
const selectedProvider = provider;
const currentModel = model;
const filteredTools = activeModule ? AI_TOOLS.filter((t) => t.module === activeModule) : AI_TOOLS;
const modules = [...new Set(AI_TOOLS.map((t) => t.module))];
const availableCount = AI_TOOLS.filter((t) => t.status === "available").length;
return (
{/* Header with icon */}
AI Tools
AI-assisted features across Harvest Reach, Products, Reports, and more.
{/* Breadcrumb */}
{/* Connection Status Banner */}
window.location.href = '/admin/settings#integrations'}
/>
{/* Provider Selector */}
{
// Local state is derived from `provider` prop. After a server
// refresh the new provider flows in via the parent re-render.
}}
/>
{/* Model Input */}
{
// Local state is derived from `model` prop. `key={currentModel}`
// remounts this component so its internal useState(currentModel)
// re-syncs to the new value.
}}
/>
{/* Module filter */}