import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';
import 'package:niogu_app/core/constants/app_color.dart';
import 'package:niogu_app/core/constants/app_font_size.dart';
import 'package:niogu_app/core/router/app_route.dart';
import 'package:niogu_app/features/stock_in/domain/entities/stock_in.dart';
import 'package:sizer/sizer.dart';

class BodySection extends StatelessWidget {
  final String label;
  final SelectedItemType type;
  const BodySection({super.key, required this.label, required this.type});

  @override
  Widget build(BuildContext context) {
    return Row(
      mainAxisAlignment: MainAxisAlignment.spaceBetween,
      children: [
        Text(
          label,
          style: TextStyle(
            fontSize: (AppFontSize.medium - 1.25).sp,
            fontWeight: FontWeight.bold,
            color: Colors.black87,
          ),
        ),
        TextButton.icon(
          onPressed: () => context.pushNamed(
            AppRoute.selectGoodScreen,
            extra: {"type": type},
          ),
          icon: Icon(
            Icons.add_circle_outline,
            size: 5.w,
            color: AppColor.primaryColor,
          ),
          label: Text(
            "Tambah Barang",
            style: TextStyle(
              color: AppColor.primaryColor,
              fontSize: (AppFontSize.medium - 1.25).sp,
              fontWeight: FontWeight.bold,
            ),
          ),
        ),
      ],
    );
  }
}
