import { useState } from 'react'; import { motion } from 'framer-motion'; import { Lightbulb, TrendingUp, ChevronDown } from 'lucide-react'; function stripMarkdown(text) { return String(text) .replace(/\*\*(.*?)\*\*/g, '$1') .replace(/\*(.*?)\*/g, '$1') .replace(/`([^`]+)`/g, '$1'); } export default function InsightBlock({ insights, explanation }) { const [expanded, setExpanded] = useState(true); const showToggle = insights?.length > 3; if (!insights?.length && !explanation) return null; return (
{stripMarkdown(explanation)}