import React, { useState } from 'react'; import hljs from 'highlight.js/lib/core'; import json from 'highlight.js/lib/languages/json'; import 'highlight.js/styles/monokai.css'; hljs.registerLanguage('json', json); export default function CollapsibleRawSections({ container }) { const [showCreation, setShowCreation] = useState(false); const [showProgress, setShowProgress] = useState(false); const [showCompletion, setShowCompletion] = useState(false); const [copied, setCopied] = useState({ creation: false, progress: false, completion: false }); const handleCopy = (section, data) => { navigator.clipboard.writeText(JSON.stringify(data, null, 2)); setCopied(prev => ({ ...prev, [section]: true })); setTimeout(() => setCopied(prev => ({ ...prev, [section]: false })), 1200); }; return (
{/* Creation Section */} {container.creation && (

setShowCreation(v => !v)} > Creation

{showCreation && (

              
)}
)} {/* Progress Section */} {container.progress && container.progress.length > 0 && (

setShowProgress(v => !v)} > Progress

{showProgress && (

              
)}
)} {/* Completion Section */} {container.completion && (

setShowCompletion(v => !v)} > Completion

{showCompletion && (

              
)}
)}
); }