import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:syncrow_app/features/devices/bloc/devices_cubit.dart';
import 'package:syncrow_app/features/shared_widgets/text_widgets/body_small.dart';

class CurtainList extends StatelessWidget {
  const CurtainList({
    super.key,
  });

  @override
  Widget build(BuildContext context) {
    return BlocBuilder<DevicesCubit, DevicesState>(
      builder: (context, state) {
        return SingleChildScrollView(
          child: Column(
            crossAxisAlignment: CrossAxisAlignment.stretch,
            children: [
              // universal AC controller
              const SizedBox(height: 10),
              //TODO: move to strings manager
              const BodySmall(text: "All Curtains"),
              const SizedBox(height: 5),
              // UniversalSwitch(
              //   category: DevicesCubit.get(context).chosenCategory!,
              // ),

              // other ACs controls
              ListView.builder(
                shrinkWrap: true,
                physics: const NeverScrollableScrollPhysics(),
                padding: const EdgeInsets.all(0),
                // itemCount:
                // DevicesCubit.get(context).chosenCategory!.devices!.length,
                itemBuilder: (context, index) {
                  // DeviceModel curtain =
                  // DevicesCubit.get(context).chosenCategory!.devices![index];
                  return Column(
                    crossAxisAlignment: CrossAxisAlignment.start,
                    children: [
                      const SizedBox(height: 20),
                      // BodySmall(
                      //     text: DevicesCubit.get(context)
                      //             .chosenCategory!
                      //             .devices![index]
                      //             .name ??
                      //         ""),
                      const SizedBox(height: 5),
                      // DevicesDefaultSwitch(
                      //   model: curtain,
                      // ),
                    ],
                  );
                },
              ),
            ],
          ),
        );
      },
    );
  }
}
