|
| 1 | +import * as React from 'react' |
| 2 | +import PropTypes from 'prop-types' |
| 3 | +import styles from './Icons.module.css' |
| 4 | +import { COLORS_ICON, SIZES, SMALL, MEDIUM, LARGE, MAIN_DARK_BLUE } from '../constants' |
| 5 | + |
| 6 | +const ScheduledJobsCreateIcon = ({ |
| 7 | + color = MAIN_DARK_BLUE, |
| 8 | + size = MEDIUM, |
| 9 | + disabled = false, |
| 10 | + inactive = false |
| 11 | +}) => { |
| 12 | + let className = `${styles.svgClassName} ` + styles[`${color}`] |
| 13 | + if (disabled) { |
| 14 | + className += ` ${styles.iconDisabled}` |
| 15 | + } |
| 16 | + if (inactive) { |
| 17 | + className += ` ${styles.iconInactive}` |
| 18 | + } |
| 19 | + let icon = <></> |
| 20 | + |
| 21 | + switch (size) { |
| 22 | + case SMALL: |
| 23 | + icon = ( |
| 24 | + <svg |
| 25 | + width={16} |
| 26 | + height={16} |
| 27 | + viewBox='0 0 16 16' |
| 28 | + fill='none' |
| 29 | + xmlns='http://www.w3.org/2000/svg' |
| 30 | + className={className} |
| 31 | + > |
| 32 | + <path d='M5.79744 11.0001C3.70017 11.0001 2 9.29539 2 7.19246C2 5.08953 3.70017 3.38477 5.79744 3.38477C7.40205 3.38477 8.77421 4.38268 9.33032 5.79334' stroke='white' strokeLinecap='round' /> |
| 33 | + <path d='M5.79715 3.38462V2M4.41626 2H7.17803' stroke='white' strokeLinecap='round' strokeLinejoin='round' /> |
| 34 | + <path d='M8.73768 4.271L9.23141 3.78706M8.74878 3.29199L9.71405 4.28213' stroke='white' strokeLinecap='round' strokeLinejoin='round' /> |
| 35 | + <path d='M3.00073 4.32316L2.52032 3.82592M2.02441 4.30762L3.01623 3.34422' stroke='white' strokeLinecap='round' strokeLinejoin='round' /> |
| 36 | + <path d='M7.00592 5.46146L5.79758 7.53839' stroke='white' strokeLinecap='round' strokeLinejoin='round' /> |
| 37 | + <circle cx='10.5' cy='10.5' r='3.5' stroke='white' /> |
| 38 | + <path d='M10.5 9V12.5' stroke='white' strokeLinecap='round' strokeLinejoin='round' /> |
| 39 | + <path d='M12.25 10.75L8.75 10.75' stroke='white' strokeLinecap='round' strokeLinejoin='round' /> |
| 40 | + </svg> |
| 41 | + ) |
| 42 | + break |
| 43 | + case MEDIUM: |
| 44 | + icon = ( |
| 45 | + <svg |
| 46 | + width={24} |
| 47 | + height={24} |
| 48 | + viewBox='0 0 24 24' |
| 49 | + fill='none' |
| 50 | + xmlns='http://www.w3.org/2000/svg' |
| 51 | + className={className} |
| 52 | + > |
| 53 | + <path d='M8.69616 16.5002C5.55026 16.5002 3 13.9431 3 10.7887C3 7.63429 5.55026 5.07715 8.69616 5.07715C11.1031 5.07715 13.1613 6.57402 13.9955 8.69001' stroke='white' strokeWidth='1.5' strokeLinecap='round' /> |
| 54 | + <path d='M8.69584 5.07692V3M6.62451 3H10.7672' stroke='white' strokeWidth='1.5' strokeLinecap='round' strokeLinejoin='round' /> |
| 55 | + <path d='M13.1066 6.40601L13.8472 5.6801M13.1233 4.9375L14.5712 6.42271' stroke='white' strokeWidth='1.5' strokeLinecap='round' strokeLinejoin='round' /> |
| 56 | + <path d='M4.50109 6.48426L3.78048 5.73839M3.03662 6.46094L4.52434 5.01584' stroke='white' strokeWidth='1.5' strokeLinecap='round' strokeLinejoin='round' /> |
| 57 | + <path d='M10.5089 8.19268L8.69637 11.3081' stroke='white' strokeWidth='1.5' strokeLinecap='round' strokeLinejoin='round' /> |
| 58 | + <circle cx='15.75' cy='15.75' r='5.25' stroke='white' strokeWidth='1.5' /> |
| 59 | + <path d='M15.75 13.5V18.75' stroke='white' strokeWidth='1.5' strokeLinecap='round' strokeLinejoin='round' /> |
| 60 | + <path d='M18.375 16.125L13.125 16.125' stroke='white' strokeWidth='1.5' strokeLinecap='round' strokeLinejoin='round' /> |
| 61 | + </svg> |
| 62 | + ) |
| 63 | + break |
| 64 | + case LARGE: |
| 65 | + icon = ( |
| 66 | + <svg |
| 67 | + width={40} |
| 68 | + height={40} |
| 69 | + viewBox='0 0 40 40' |
| 70 | + fill='none' |
| 71 | + xmlns='http://www.w3.org/2000/svg' |
| 72 | + className={className} |
| 73 | + > |
| 74 | + <path d='M14.4936 27.5004C9.25043 27.5004 5 23.2385 5 17.9811C5 12.7238 9.25043 8.46191 14.4936 8.46191C18.5051 8.46191 21.9355 10.9567 23.3258 14.4833' stroke='white' strokeWidth='2' strokeLinecap='round' /> |
| 75 | + <path d='M14.493 8.46154V5M11.0408 5H17.9452' stroke='white' strokeWidth='2' strokeLinecap='round' strokeLinejoin='round' /> |
| 76 | + <path d='M21.8443 10.677L23.0787 9.46716M21.8721 8.22949L24.2852 10.7048' stroke='white' strokeWidth='2' strokeLinecap='round' strokeLinejoin='round' /> |
| 77 | + <path d='M7.50206 10.8074L6.30105 9.5643M5.06128 10.7686L7.54082 8.36005' stroke='white' strokeWidth='2' strokeLinecap='round' strokeLinejoin='round' /> |
| 78 | + <path d='M17.5148 13.6541L14.4939 18.8465' stroke='white' strokeWidth='2' strokeLinecap='round' strokeLinejoin='round' /> |
| 79 | + <circle cx='26.25' cy='26.25' r='8.75' stroke='white' strokeWidth='2' /> |
| 80 | + <path d='M26.25 22.5V31.25' stroke='white' strokeWidth='2' strokeLinecap='round' strokeLinejoin='round' /> |
| 81 | + <path d='M30.625 26.875L21.875 26.875' stroke='white' strokeWidth='2' strokeLinecap='round' strokeLinejoin='round' /> |
| 82 | + </svg> |
| 83 | + ) |
| 84 | + break |
| 85 | + |
| 86 | + default: |
| 87 | + break |
| 88 | + } |
| 89 | + return icon |
| 90 | +} |
| 91 | + |
| 92 | +ScheduledJobsCreateIcon.propTypes = { |
| 93 | + /** |
| 94 | + * color of text, icon and borders |
| 95 | + */ |
| 96 | + color: PropTypes.oneOf(COLORS_ICON), |
| 97 | + /** |
| 98 | + * Size |
| 99 | + */ |
| 100 | + size: PropTypes.oneOf(SIZES), |
| 101 | + /** |
| 102 | + * disabled |
| 103 | + */ |
| 104 | + disabled: PropTypes.bool, |
| 105 | + /** |
| 106 | + * inactive |
| 107 | + */ |
| 108 | + inactive: PropTypes.bool |
| 109 | +} |
| 110 | + |
| 111 | +export default ScheduledJobsCreateIcon |
0 commit comments