import 'package:flutter/cupertino.dart';
import 'package:keyboard/module/intimacy_analyse/analyse_report/widget/report_section_widget.dart';
import 'package:keyboard/module/intimacy_analyse/analyse_report/widget/report_title_widget.dart';

import '../../../../data/bean/intimacy_analyse_report.dart';

/// 亲密度分析-报告列表项
class ReportItemWidget extends StatelessWidget {
  final AnalyseItem item;

  const ReportItemWidget({required this.item, super.key});

  @override
  Widget build(BuildContext context) {
    return Column(
      mainAxisAlignment: MainAxisAlignment.start,
      // 左对齐
      crossAxisAlignment: CrossAxisAlignment.start,
      children: [
        SizedBox(height: 5,),
        // 标题
        ReportTitleWidget(title: item.title),
        // 标题与段落的间隔
        SizedBox(height: 10,),
        ...item.sections.map<Widget>((ele) {
          return Column(children: [
            // 段落
            ReportSectionWidget(selection: ele),
            // 段落间隔
            SizedBox(height: 2,)
          ],);
        }),
      ],
    );
  }
}
