import React from "react";
import { Col, Tooltip } from "antd";

const Coltext = ({ label, value, col, id }) => {
  const getCol = () => {
    return col ? col : { xs: 24, sm: 24, md: 24, lg: 8, xl: 8, xxl: 8 };
  };
  return (
    <Col {...getCol()} key={id || "id"}>
      <div style={{ display: "flex", curitem: "center" }}>
        <div style={{ minWidth: 50, flexShrink: 0 }}>{label}：</div>
        <Tooltip title={value}>
          <div
            style={{
              overflow: "hidden",
              whiteSpace: "nowrap",
              textOverflow: "ellipsis",
            }}
          >
            {value || "-"}
          </div>
        </Tooltip>
      </div>
    </Col>
  );
};

export default Coltext;
