import 'package:flutter/material.dart';
import 'package:test_sa/controllers/localization/localization.dart';
import 'package:test_sa/models/device/device_transfer_info.dart';
import 'package:test_sa/views/app_style/colors.dart';
import 'package:test_sa/views/widgets/loaders/image_loader.dart';
import 'package:test_sa/views/widgets/requests/info_row.dart';
import 'package:test_sa/views/widgets/requests/request_status.dart';
class DeviceTransferInfoSection extends StatelessWidget {
  final DeviceTransferInfo info;
  final VoidCallback onEdit;
  const DeviceTransferInfoSection({Key key, this.info, this.onEdit}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    final subtitle = AppLocalization.of(context).subtitle;
    return Column(
      children: [
        RequestInfoRow(
          title: subtitle.hospital,
          info: info.client.name,
        ),
        RequestInfoRow(
          title: subtitle.unite,
          info: info.department.name,
        ),
        RequestInfoRow(
          title: subtitle.engineerName,
          info: info.userName,
        ),
        RequestInfoRow(
          title: subtitle.workingHours,
          info: info.workingHours,
        ),
        RequestInfoRow(
          title: subtitle.travelingHours,
          info: info.travelingHours,
        ),
        RequestInfoRow(
          title: "Comment",
          info: info.comment,
        ),
        RequestInfoRow(
          title: "Signature",
          info: info.signature?.isEmpty != false
           ? subtitle.noDateFound : null,
          contentWidget: info.signature?.isEmpty != false ? null :
          ImageLoader(
            url: info.signature,
          ),
        ),
        RequestInfoRow(
          title: subtitle.status,
          infoWidget: StatusLabel(
              label: info.status?.name,
              color: AColors.getGasStatusColor(info.status?.id)
          ),
        ),
      ],
    );
  }
}
