import 'package:flutter/material.dart';
import 'package:niogu_app/core/enums/sync_status.dart';
import 'package:sizer/sizer.dart';

class SyncIcon extends StatelessWidget {
  final SyncStatus syncStatus;

  const SyncIcon({super.key, required this.syncStatus});

  @override
  Widget build(BuildContext context) {
    switch (syncStatus) {
      case SyncStatus.dirty:
        return Icon(
          Icons.cloud_queue_outlined,
          color: Colors.amberAccent,
          size: 6.w,
        );
      case SyncStatus.syncing:
        return SizedBox(
          width: 6.w,
          height: 6.w,
          child: const CircularProgressIndicator(
            color: Colors.white,
            strokeWidth: 2,
          ),
        );
      case SyncStatus.failed:
        return Icon(
          Icons.cloud_off_rounded,
          color: Colors.redAccent,
          size: 6.w,
        );
      case SyncStatus.synced:
        return Icon(
          Icons.cloud_done_rounded,
          color: Colors.greenAccent,
          size: 6.w,
        );
    }
  }
}