import 'package:flutter/material.dart';
import 'package:get/get.dart';
import '../index.dart';

class NoCardReaderView extends GetView<CardReaderController> {
  const NoCardReaderView({super.key});
  @override
  Widget build(BuildContext context) {
    return Column(
      mainAxisAlignment: MainAxisAlignment.center,
      children: [
        const Icon(
          Icons.warning_amber_rounded,
          size: 80,
          color: Colors.red,
        ),
        const SizedBox(height: 20),
        Text(
          controller.isCardReaderBinding ? '未连接读卡器' : '未绑定读卡器',
          style: const TextStyle(
            fontSize: 26,
            fontWeight: FontWeight.bold,
          ),
        ),
        const SizedBox(height: 20),
        Text(
          controller.isCardReaderBinding ? "读卡器连接失败请检查" : '请在设置中心绑定读卡器',
          style: const TextStyle(
            fontSize: 18,
            color: Colors.grey,
          ),
          textAlign: TextAlign.center,
        ),
        const SizedBox(height: 20),
        if (controller.isCardReaderBinding)
          ElevatedButton(
            onPressed: () {
              controller.checkReader();
            },
            child: const Text(
              '重试',
              style: TextStyle(fontSize: 20),
            ),
          ),
        const SizedBox(height: 40),
      ],
    );
  }
}
