import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:vnoteapp/components/appbar.dart';
import 'package:vnoteapp/components/dynamic_drawer.dart';

import 'controller.dart';
import 'widgets/base_info.dart';
import 'widgets/functions_panel.dart';
import 'widgets/tag_cards.dart';

class PatientDetailPage extends GetView<PatientDetailController> {
  const PatientDetailPage({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      key: controller.drawerGlobalScaffoldKey,
      appBar: VAppBar(
        context: context,
        titleWidget: Obx(
          () => Text(
            "${controller.state.name}档案详情",
            style: const TextStyle(fontSize: 24),
          ),
        ),
      ),
      backgroundColor: Colors.grey.shade200,
      endDrawer: VDynamicDrawerWrapper(
        scaffoldKey: controller.drawerGlobalScaffoldKey,
      ),
      body: Container(
        margin: const EdgeInsets.only(top: 2),
        child: Row(
          children: [
            Container(
              width: 440,
              padding: const EdgeInsets.only(
                left: 12,
                top: 8,
                // right: 8,
                bottom: 8,
              ),
              child: Container(
                padding: const EdgeInsets.only(right: 8),
                child: const Column(
                  mainAxisSize: MainAxisSize.max,
                  children: [
                    BaseInfoCard(),
                    SizedBox(height: 12),
                    Expanded(
                      child: CrowdLabelsCard(),
                    ),
                    SizedBox(height: 12),
                    Expanded(child: FollowupTipsCard()),
                  ],
                ),
              ),
            ),
            const Expanded(child: FunctionsPanel()),
          ],
        ),
      ),
    );
  }
}
