import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:gap/gap.dart';
import 'package:intl/intl.dart';
import 'package:krow/core/presentation/styles/kw_box_decorations.dart';
import 'package:krow/core/presentation/styles/kw_text_styles.dart';
import 'package:krow/core/presentation/styles/theme.dart';
import 'package:krow/features/shifts/domain/shift_entity.dart';

class ShiftInfoStartWidget extends StatelessWidget {
  final ShiftEntity viewModel;

  const ShiftInfoStartWidget({super.key, required this.viewModel});

  @override
  Widget build(BuildContext context) {
    var dateTime = viewModel.startDate;

    var date = DateFormat('MMMM d', context.locale.languageCode).format(dateTime);
    var time = DateFormat('h:mma', 'en').format(dateTime).toLowerCase();
    return Expanded(
      child: Container(
        padding: const EdgeInsets.all(12),
        decoration: KwBoxDecorations.primaryLight12,
        child: Column(
          crossAxisAlignment: CrossAxisAlignment.start,
          children: [
            Text('start'.tr().toUpperCase(),
                style: AppTextStyles.captionReg
                    .copyWith(color: AppColors.blackCaptionText)),
            const Gap(16),
            Text(date, style: AppTextStyles.headingH3),
            const Gap(6),
            Text('date'.tr(),
                style: AppTextStyles.bodySmallReg
                    .copyWith(color: AppColors.blackGray)),
            const Gap(12),
            Text(time, style: AppTextStyles.headingH3),
            const Gap(6),
            Text('time'.tr(),
                style: AppTextStyles.bodySmallReg
                    .copyWith(color: AppColors.blackGray)),
          ],
        ),
      ),
    );
  }
}
