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

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

class SideBarCard extends StatelessWidget {
  const SideBarCard(
      {super.key,
      required this.massnahme,
      required this.title,
      required this.content});

  final MeasureComplete massnahme;
  final String title;
  final List<Widget> content;

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

    return SizedBox(
      width: double.infinity,
      child: Card(
        shape: RoundedRectangleBorder(
          borderRadius: BorderRadius.circular(8),
        ),
        elevation: 0,
        color: greenColors['primary']!..withValues(alpha: .1),
        child: Padding(
          padding: const EdgeInsets.all(16),
          child: Column(
            crossAxisAlignment: CrossAxisAlignment.start,
            children: [
              Text(
                context.translate(title),
                style: theme.currentThemeData.textTheme.labelMedium
                    ?.copyWith(color: theme.currentColorScheme.primary),
              ),
              theme.verticalSpacerSmall,
              ...content
            ],
          ),
        ),
      ),
    );
  }
}
