import 'package:eva_icons_flutter/eva_icons_flutter.dart';
import 'package:flutter/material.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:mitra_corporate/provider/menu_provider.dart';
import 'package:mitra_corporate/screen/surat_jalan/table_detail_surat_jalan.dart';

import 'package:mitra_corporate/widgets/header.dart';

import '../../app/constant.dart';
import '../../provider/surat_jalan_provider.dart';

class SuratJalanDetailScreen extends HookConsumerWidget {
  const SuratJalanDetailScreen({super.key});

  @override
  Widget build(BuildContext context, WidgetRef ref) {
    final sjNumber = ref.watch(suratJalanNumber);

    return Material(
      child: Column(
        children: [
          Header(),
          Container(
            child: Padding(
              padding: const EdgeInsets.all(32.0),
              child: Column(
                crossAxisAlignment: CrossAxisAlignment.start,
                children: [
                  Row(
                    children: [
                      IconButton(
                          onPressed: () {
                            ref.read(currentMenuProvider.notifier).state = 3;
                          },
                          icon: Icon(EvaIcons.arrowBackOutline)),
                      Text('Detail Surat Jalan',
                          style: Constant.h4_600(context: context)
                              .copyWith(color: Constant.textBlack)),
                    ],
                  ),
                  SizedBox(
                    height: Constant.getActualY(context: context, y: 40),
                  ),
                  Container(
                    decoration: BoxDecoration(
                      borderRadius: BorderRadius.circular(12),
                      color: Colors.white,
                    ),
                    padding: EdgeInsets.symmetric(
                        horizontal:
                            Constant.getActualY(context: context, y: 24),
                        vertical: Constant.getActualY(context: context, y: 24)),
                    child: Column(
                      children: [
                        Row(children: [
                          Text('Nomor Surat Jalan',
                              style: Constant.body1_600(context: context)
                                  .copyWith(color: Constant.textBlack)),
                          SizedBox(
                              width:
                                  Constant.getActualX(context: context, x: 8)),
                          Text(sjNumber,
                              style: Constant.body1_600(context: context)
                                  .copyWith(color: Constant.primaryRed)),
                        ]),
                        SizedBox(
                            height:
                                Constant.getActualY(context: context, y: 24)),
                        // SizedBox(
                        //     height: Constant.getActualY(context: context, y: 24)),
                        TableDetailSuratJalan()
                      ],
                    ),
                  ),
                ],
              ),
            ),
          )
        ],
      ),
    );
  }
}
