import 'package:didvan/config/design_config.dart';
import 'package:didvan/config/theme_data.dart';
import 'package:flutter/material.dart';
import 'package:skeleton_text/skeleton_text.dart';

class ShimmerPlaceholder extends StatelessWidget {
  final double? height;
  final double? width;
  final BorderRadius? borderRadius;

  const ShimmerPlaceholder({
    Key? key,
    this.height,
    this.width,
    this.borderRadius = DesignConfig.lowBorderRadius,
  }) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return SkeletonAnimation(
      borderRadius: borderRadius!,
      shimmerColor: Theme.of(context).colorScheme.secondCTA,
      gradientColor: Theme.of(context).colorScheme.cardBorder,
      child: Container(
        height: height,
        width: width,
        decoration: BoxDecoration(
          color: DesignConfig.isDark
              ? Theme.of(context).colorScheme.focused
              : Theme.of(context).colorScheme.disabledBackground,
          borderRadius: borderRadius,
        ),
      ),
    );
  }
}
