import 'package:didvan/config/theme_data.dart';
import 'package:didvan/constants/app_icons.dart';
import 'package:didvan/utils/date_time.dart';
import 'package:didvan/views/widgets/didvan/text.dart';
import 'package:flutter/material.dart';

class DurationWidget extends StatelessWidget {
  final int duration;
  const DurationWidget({Key? key, required this.duration}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Container(
      padding: const EdgeInsets.all(4),
      decoration: BoxDecoration(
        border: Border.all(
          color: Theme.of(context).colorScheme.focusedBorder,
        ),
        borderRadius: BorderRadius.circular(5),
      ),
      child: Row(
        children: [
          Icon(
            DidvanIcons.timer_regular,
            size: 18,
            color: Theme.of(context).colorScheme.focusedBorder,
          ),
          const SizedBox(width: 4),
          DidvanText(
            DateTimeUtils.normalizeTimeDuration(
              Duration(seconds: duration),
            ),
            isEnglishFont: true,
            style: Theme.of(context).textTheme.bodySmall,
            color: Theme.of(context).colorScheme.focusedBorder,
          ),
          const SizedBox(width: 4),
          Icon(
            DidvanIcons.play_circle_regular,
            size: 18,
            color: Theme.of(context).colorScheme.focusedBorder,
          ),
        ],
      ),
    );
  }
}
