SiteLabelView.js 636 B

12345678910111213141516171819202122232425262728293031323334
  1. /**
  2. * 站点标签组件
  3. * @邠心vbe on 2023/11/30
  4. */
  5. import React from 'react';
  6. import TextView from './TextView';
  7. const SiteLabelView = ({
  8. label,
  9. color = textLight,
  10. background = colorPrimary
  11. }) => {
  12. if (label) {
  13. return (
  14. <TextView
  15. style={{
  16. color: color || textLight,
  17. height: 22,
  18. fontSize: 12,
  19. marginRight: 5,
  20. marginBottom: 5,
  21. borderRadius: 3,
  22. ...$padding(0, 6),
  23. backgroundColor: background || colorPrimary
  24. }}>
  25. {label}
  26. </TextView>
  27. )
  28. } else {
  29. return <></>
  30. }
  31. };
  32. export default SiteLabelView;