> ## Documentation Index
> Fetch the complete documentation index at: https://styleguide-nextjs.2smooth.io/llms.txt
> Use this file to discover all available pages before exploring further.

# คุณภาพของโค้ด

export const CLASSIFICATION_TERMS = {
  positive: {
    must: '+MUST',
    should: '+SHOULD',
    optional: '+OPTIONAL'
  },
  negative: {
    must: '-MUST',
    should: '-SHOULD',
    optional: '-OPTIONAL'
  }
};

export const TextHighlight = ({text = '', positive = false, negative = false}) => {
  let textColor = undefined;
  let bgColor = undefined;
  if (positive) {
    textColor = 'black';
    bgColor = 'oklch(72.77% 0.1798 128.27)';
  }
  if (negative) {
    textColor = 'black';
    bgColor = 'oklch(51.73% 0.2119 28.74)';
  }
  return <div style={{
    display: 'inline-block',
    fontWeight: 'bold',
    paddingLeft: '4px',
    paddingRight: '4px',
    border: '1px solid',
    borderRadius: '8px',
    color: textColor,
    backgroundColor: bgColor
  }}>
      {text}
    </div>;
};

* <TextHighlight positive text={ CLASSIFICATION_TERMS.positive.must } /> ต้องเขียนโดยยึดหลักการของ [Clean Code](https://medium.com/linedevth/%E0%B9%80%E0%B8%82%E0%B8%B5%E0%B8%A2%E0%B8%99-code-%E0%B9%83%E0%B8%AB%E0%B9%89-clean-%E0%B8%82%E0%B8%B6%E0%B9%89%E0%B8%99-%E0%B8%94%E0%B9%89%E0%B8%A7%E0%B8%A2%E0%B9%80%E0%B8%97%E0%B8%84%E0%B8%99%E0%B8%B4%E0%B8%84-clean-code-%E0%B8%88%E0%B8%B2%E0%B8%81%E0%B8%A5%E0%B8%B8%E0%B8%87-robert-c-martin-4bbe39be4695)
* <TextHighlight positive text={ CLASSIFICATION_TERMS.positive.must } /> อ่านง่าย (Readability)
* <TextHighlight positive text={ CLASSIFICATION_TERMS.positive.should } /> บำรุงรักษาง่าย (Maintainability)
* <TextHighlight positive text={ CLASSIFICATION_TERMS.positive.must } /> มีประสิทธิภาพ (Efficiency)
* <TextHighlight positive text={ CLASSIFICATION_TERMS.positive.must } /> น่าเชื่อถือ (Reliability)
* <TextHighlight positive text={ CLASSIFICATION_TERMS.positive.should } /> สามารถนำไปใช้ซ้ำได้ (Reusability)
