import 'package:ambito/src/entity/measure/complete/measure_complete.dart';
import 'package:flutter/material.dart';

import '../../../../packages/ambito_theme/ambito_theme.dart';
import '_sidebar_card.dart';

class TocCard extends StatelessWidget {
  const TocCard({
    super.key,
    required this.massnahme,
    required this.items,
    required this.scrollController,
  });

  final MeasureComplete massnahme;
  final List<String> items;
  final ScrollController scrollController;

  @override
  Widget build(BuildContext context) {
    final AmbitoTheme theme = getTheme(context);

    return SideBarCard(
      massnahme: massnahme,
      title: 'page.actionDetailPage.toc.title',
      content: items
          .map((item) => Row(
                children: [
                  SizedBox(width: 30, child:
                  Text(
                    '${items.indexOf(item) + 1}. ',
                    style: theme.bodyMedium,
                  ),),
                  Expanded(
                    child: InkWell(
                      child: Text(
                        item,
                        style: theme.bodyMedium,
                      ),
                    ),
                  )
                ],
              ))
          .toList(),
    );
  }
}
