'use client'; import React, { useState } from 'react'; import { FileExample } from './FileExample'; import type { FileExampleGroup } from '../data/fileExamples'; interface FileExamplesListProps { groups: FileExampleGroup[]; } export const FileExamplesList: React.FC = ({ groups }) => { const [expandedGroups, setExpandedGroups] = useState>({}); const toggleAllInGroup = (groupId: string, files: any[]) => { const isAnyExpanded = files.some(f => expandedGroups[f.id]); const newExpanded = { ...expandedGroups }; files.forEach(f => { newExpanded[f.id] = !isAnyExpanded; }); setExpandedGroups(newExpanded); }; if (groups.length === 0) { return (

No files found

); } return (
{groups.map((group) => (

{group.title}

{group.files.length} files
{group.files.map((file) => ( ))}
))}
); };