import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:taafee_mobile/common/extensions/widget_extension.dart';
import 'package:taafee_mobile/common/widgets/header_screen.dart';
import 'package:taafee_mobile/common/widgets/listview.dart';
import 'package:taafee_mobile/common/widgets/rx_viewer.dart';
import 'package:taafee_mobile/features/card/business_logic_layer/card_controller.dart';
import 'package:taafee_mobile/features/card/presentation_layer/widgets/feedback_widget.dart';

class FeedbackScreen extends StatelessWidget {
  final CardController cardController = Get.find<CardController>();
  FeedbackScreen({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Column(
        children: [
          HeaderScreen(
            "Feedback",
          ).paddingOnly(top: 20),
          RxViewer(
            rxFuture: cardController.feedbackState,
            child: () => SizedBox(
              width: Get.width,
              child: ListViewWidget(
                  itemCount: cardController.feedbackState.result.length,
                  childBuilder: (index) {
                    return FeedbackWidget(
                      feedbackModel: cardController.feedbackState.result[index],
                    );
                  }),
            ),
          )
        ],
      ),
    ).makeSafeArea();
  }
}
