diff --git a/src/components/icons/WellIcon.tsx b/src/components/icons/WellIcon.tsx new file mode 100644 index 0000000..02ddfc0 --- /dev/null +++ b/src/components/icons/WellIcon.tsx @@ -0,0 +1,69 @@ +import React from 'react' + +type WellIconColors = { + online?: string + active?: string + inactive?: string + unknown?: string +} + +interface WellIconProps { + width?: string | number + height?: string | number + online?: boolean + state?: 'active' | 'inactive' | 'unknown' + colors?: WellIconColors +} + +const defaultColors: WellIconColors = { + online: 'red', + active: 'green', + inactive: 'gainsboro', + unknown: 'gainsboro', +} + +const defaultProps: WellIconProps = { + width: 24, + height: 24, + state: 'unknown', +} + +export const WellIcon = React.memo(({ width, height, state, online, colors, ...other } : WellIconProps = defaultProps) => { + colors = {...defaultColors, ...colors} + + return ( + + + + + + + + {online && ( // Полоски, показывающие наличие свежей телеметрии + + + + + + )} + + ) +}) + +export default WellIcon