import 'package:fis_jsonrpc/rpc.dart';
import 'package:flutter/material.dart';

class ContractUtils {
  String contractStateTransition(ContractStateEnum state) {
    switch (state) {
      case ContractStateEnum.Unsigned:
        return "待签约";
      case ContractStateEnum.Cancelled:
        return "已解约";
      case ContractStateEnum.Expired:
        return "已过期";
      case ContractStateEnum.Signed:
        return "已签约";
      case ContractStateEnum.Voided:
        return "已作废";
      case ContractStateEnum.Refused:
        return "已拒签";
      default:
        return "";
    }
  }

  Color contractStateColors(ContractStateEnum state) {
    switch (state) {
      case ContractStateEnum.Unsigned:
        return Colors.grey;
      case ContractStateEnum.Cancelled:
        return Colors.red;
      case ContractStateEnum.Expired:
        return Colors.orange;
      case ContractStateEnum.Signed:
        return Colors.green;
      case ContractStateEnum.Voided:
        return Colors.red;
      case ContractStateEnum.Refused:
        return const Color.fromARGB(255, 4, 66, 116);
      default:
        return Colors.blue;
    }
  }
}
