import 'package:flutter/material.dart';
import 'package:intl/intl.dart';
import 'package:test_sa/extensions/context_extension.dart';
import 'package:test_sa/extensions/int_extensions.dart';
import 'package:test_sa/extensions/text_extensions.dart';
import 'package:test_sa/extensions/widget_extensions.dart';

import '../../../app_style/app_color.dart';

class CalendarHeader extends StatelessWidget {
  final DateTime dateTime;
  final DateFormat dateFormat;

  const CalendarHeader({required this.dateTime, required this.dateFormat, Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Column(
      children: [
        Row(
          children: [
            dateFormat.format(dateTime).heading5(context),
            6.width,
            Align(alignment: AlignmentDirectional.centerEnd, child: Icon(Icons.keyboard_arrow_down_sharp, color: context.isDark ? AppColor.neutral10 : AppColor.neutral60, size: 24)),
            const Spacer(),
            Align(alignment: AlignmentDirectional.centerEnd, child: Icon(Icons.calendar_today, color: context.isDark ? AppColor.neutral10 : AppColor.neutral60, size: 18)),
          ],
        ),
        8.height,
        const Divider().defaultStyle(context),
      ],
    );
  }
}
