index.jsx 723 Bytes
Newer Older
wuhao's avatar
wuhao committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
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;