import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:syncrow_web/pages/device_managment/shared/device_controls_container.dart';
import 'package:syncrow_web/utils/color_manager.dart';
import 'package:syncrow_web/utils/constants/assets.dart';

class PresenceState extends StatelessWidget {
  const PresenceState({
    super.key,
    required this.value,
  });

  final String value;

  @override
  Widget build(BuildContext context) {
    return DeviceControlsContainer(
      child: Column(
        crossAxisAlignment: CrossAxisAlignment.center,
        mainAxisAlignment: MainAxisAlignment.spaceBetween,
        children: [
          Row(
            mainAxisAlignment: MainAxisAlignment.start,
            children: [
              Text(
                'Status:',
                style: Theme.of(context).textTheme.bodySmall!.copyWith(
                    color: ColorsManager.blackColor, fontWeight: FontWeight.w400, fontSize: 10),
              ),
            ],
          ),
          SvgPicture.asset(
            value.toLowerCase() == 'motion'
                ? Assets.sensorMotionIcon
                : value.toLowerCase() == 'presence'
                    ? Assets.sensorPresenceIcon
                    : Assets.sensorVacantIcon,
            width: 60,
            height: 60,
          ),
          Text(
            value,
            style: Theme.of(context).textTheme.bodySmall!.copyWith(
                color: ColorsManager.blackColor, fontWeight: FontWeight.w400, fontSize: 16),
          ),
        ],
      ),
    );
  }
}
