import 'package:flutter/material.dart';
import 'package:shimmer/shimmer.dart';
import '../../theme/colors/app_colors.dart';
import '../../utils/app_utils.dart';

class ShimmerWidget extends StatelessWidget {
  const ShimmerWidget({
    super.key,
    required this.width,
    required this.height,
    this.borderRadius = AppUtils.kBorderRadius6,
    this.margin,
  });

  final double width;
  final double height;
  final BorderRadiusGeometry? borderRadius;
  final EdgeInsetsGeometry? margin;

  @override
  Widget build(BuildContext context) {
    return Shimmer.fromColors(
      enabled: true,
      baseColor:
          Theme.of(context).brightness == Brightness.dark
              ? const Color(0x80FFFFFF)
              : const Color(0xffF8F8F9),
      highlightColor: LightThemeColors.shimmerHighlight,
      child: Container(
        width: width,
        height: height,
        margin: margin,
        decoration: BoxDecoration(
          color: LightThemeColors.white,
          borderRadius: borderRadius,
        ),
      ),
    );
  }
}
