import 'package:flutter/material.dart';

import 'day_of_week_cell.dart';

/// 根据7天生成对应没每一天的星期
class DayOfWeekView extends StatelessWidget {
  const DayOfWeekView({
    super.key,
    required this.weekdays,
  });

  final List<DateTime> weekdays;

  @override
  Widget build(BuildContext context) {
    return Table(
      children: [
        TableRow(
          children: weekdays
              .map(
                (date) => DayOfWeekCell(
                  date: date,
                ),
              )
              .toList(),
        ),
      ],
    );
  }
}
