import { Image } from "antd";
import { Fragment } from "react";
import { getFileUrl } from "zy-react-library/utils";

function OpinionSign({
  title,
  colSpan,
  remarks,
  signPath,
  signTime,
}) {
  const show = signPath || remarks || signTime;

  return (
    <Fragment>
      {
        show && (
          <tr>
            <td colSpan={colSpan}>
              <div className="flex">
                <div>
                  <span>
                    {title}
                    ：
                  </span>
                  <span className="remarks" style={{ display: "inline" }}>{remarks}</span>
                </div>
                <div className="right">
                  <div>
                    <span>签字：</span>
                    <span>
                      {signPath && <Image src={getFileUrl() + signPath} width={50} height={50} />}
                    </span>
                    <div>{signTime}</div>
                  </div>
                </div>
              </div>
            </td>
          </tr>
        )
      }
    </Fragment>
  );
}

export default OpinionSign;
