import { globalColor } from "@/utils/colorBuilder"
import { css } from "@emotion/react"
import { Theme } from "@mui/material"


const getLabelStyleBySize = (size: "medium" | "small", theme: Theme) => {
  switch (size) {
    case "medium": {
      return css`
        font-size: 14px;
        color:${theme.palette.text.primary}
      `
    }
    case "small": {
      return css`
        font-size: 12px;
 color:${theme.palette.text.secondary}
      `
    }
  }
}

export function applyLabelTipsStyle(
  hasLabelDesc: boolean,
  size: "medium" | "small",
  theme: Theme
) {
  const borderBottomStyle = hasLabelDesc
    ? css`
        border-bottom: 1px dashed ${theme.palette.action.focus};
      `
    : css``
  return css`
    height: 22px;
    line-height: 22px;
    font-weight: 500;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    ${getLabelStyleBySize(size, theme)}
    ${borderBottomStyle};
  `
}
