import 'package:flutter/material.dart';
import 'package:hugeicons/hugeicons.dart';

@immutable
class AppIconGlyph {
  const AppIconGlyph.material(this.material) : huge = null;
  const AppIconGlyph.huge(this.huge) : material = null;

  final IconData? material;
  final List<List<dynamic>>? huge;
}

class AppIcon extends StatelessWidget {
  const AppIcon({
    super.key,
    required this.glyph,
    this.color,
    this.size,
    this.strokeWidth,
    this.semanticLabel,
  });

  final AppIconGlyph glyph;
  final Color? color;
  final double? size;
  final double? strokeWidth;
  final String? semanticLabel;

  @override
  Widget build(BuildContext context) {
    final huge = glyph.huge;
    if (huge != null) {
      return HugeIcon(
        icon: huge,
        color: color,
        size: size,
        strokeWidth: strokeWidth,
      );
    }

    return Icon(
      glyph.material,
      color: color,
      size: size,
      semanticLabel: semanticLabel,
    );
  }
}

class AppIcons {
  const AppIcons._();

  static const AppIconGlyph home =
      AppIconGlyph.huge(HugeIcons.strokeRoundedHome01);
  static const AppIconGlyph calendar =
      AppIconGlyph.huge(HugeIcons.strokeRoundedCalendar01);
  static const AppIconGlyph quran =
      AppIconGlyph.huge(HugeIcons.strokeRoundedQuran02);
  static const AppIconGlyph dzikir =
      AppIconGlyph.huge(HugeIcons.strokeRoundedTasbih);
  static const AppIconGlyph lainnya =
      AppIconGlyph.huge(HugeIcons.strokeRoundedGridView);
  static const AppIconGlyph ibadah =
      AppIconGlyph.huge(HugeIcons.strokeRoundedCheckList);
  static const AppIconGlyph laporan =
      AppIconGlyph.huge(HugeIcons.strokeRoundedChart01);

  static const AppIconGlyph murattal =
      AppIconGlyph.huge(HugeIcons.strokeRoundedHeadset);
  static const AppIconGlyph qibla =
      AppIconGlyph.huge(HugeIcons.strokeRoundedCompass);
  static const AppIconGlyph doa = AppIconGlyph.huge(HugeIcons.strokeRoundedDua);
  static const AppIconGlyph hadits =
      AppIconGlyph.huge(HugeIcons.strokeRoundedBooks01);
  static const AppIconGlyph quranEnrichment =
      AppIconGlyph.huge(HugeIcons.strokeRoundedQuran01);

  static const AppIconGlyph notification =
      AppIconGlyph.huge(HugeIcons.strokeRoundedNotification03);
  static const AppIconGlyph settings =
      AppIconGlyph.huge(HugeIcons.strokeRoundedSettings02);
  static const AppIconGlyph share =
      AppIconGlyph.huge(HugeIcons.strokeRoundedShare01);
  static const AppIconGlyph themeMoon =
      AppIconGlyph.huge(HugeIcons.strokeRoundedMoon02);
  static const AppIconGlyph themeSun =
      AppIconGlyph.huge(HugeIcons.strokeRoundedSun02);
  static const AppIconGlyph checkCircle =
      AppIconGlyph.huge(HugeIcons.strokeRoundedCheckmarkCircle02);
  static const AppIconGlyph circle =
      AppIconGlyph.huge(HugeIcons.strokeRoundedCircle);
  static const AppIconGlyph musicNote =
      AppIconGlyph.huge(HugeIcons.strokeRoundedMusicNote01);
  static const AppIconGlyph shuffle =
      AppIconGlyph.huge(HugeIcons.strokeRoundedShuffle);
  static const AppIconGlyph previousTrack =
      AppIconGlyph.huge(HugeIcons.strokeRoundedPrevious);
  static const AppIconGlyph nextTrack =
      AppIconGlyph.huge(HugeIcons.strokeRoundedNext);
  static const AppIconGlyph play =
      AppIconGlyph.huge(HugeIcons.strokeRoundedPlay);
  static const AppIconGlyph pause =
      AppIconGlyph.huge(HugeIcons.strokeRoundedPause);
  static const AppIconGlyph playlist =
      AppIconGlyph.huge(HugeIcons.strokeRoundedPlaylist01);
  static const AppIconGlyph user =
      AppIconGlyph.huge(HugeIcons.strokeRoundedUser03);
  static const AppIconGlyph arrowDown =
      AppIconGlyph.huge(HugeIcons.strokeRoundedArrowDown01);

  static const AppIconGlyph backArrow =
      AppIconGlyph.huge(HugeIcons.strokeRoundedArrowLeft01);
  static const AppIconGlyph location =
      AppIconGlyph.huge(HugeIcons.strokeRoundedMosqueLocation);
  static const AppIconGlyph locationActive =
      AppIconGlyph.huge(HugeIcons.strokeRoundedLocation01);
  static const AppIconGlyph locationOffline =
      AppIconGlyph.huge(HugeIcons.strokeRoundedLocationOffline01);
}
