import React from 'react' ; import { Svg , Circle , ClipPath , Path , Defs , LinearGradient , Stop , G , } from 'react-native-svg' ; import { StyleProp , ViewStyle } from 'react-native' ; type Props = { progress : number ; style ? : StyleProp < ViewStyle > ; withPlus ? : boolean ; plusColor ? : string ; } ; export default function Wave ( props ) { const { progress , withPlus , plusColor , style } = props ; const length = 630 ; const offset = length * ( 100 - progress ) / 100 ; return ( < Svg width = "100%" height = "100%" viewBox = "0 0 218 220" fill = "none" style = { style } > < Defs > { } < ClipPath id = "wave-clip" clipRule = "evenodd" > < G > < Path fillRule = "evenodd" transform = "rotate(90 110 110)" d = "M167.749 197.47C169.107 196.479 170.446 195.449 171.767 194.381C181.435 186.557 189.117 177.051 194.834 166.501C195.424 165.54 196.003 164.568 196.574 163.586C205.191 148.759 217.037 128.254 217.152 110.071C217.248 94.8703 208.228 80.4389 200.111 67.4512C199.034 65.7276 197.972 64.0294 196.95 62.3582C183.624 34.9578 158.435 14.3466 127.427 7.03459C125.706 6.21235 124.158 5.17409 122.629 4.1491C119.805 2.25553 117.048 0.407225 113.395 0.0497075C110.242 -0.258805 106.163 0.92399 102.206 2.07139C99.6143 2.82281 97.0752 3.55905 94.8829 3.85132C84.83 4.43592 75.4135 6.37855 66.7223 9.48522C56.1605 13.2068 46.0631 18.7557 36.8825 26.1848C32.2165 29.9606 27.0144 32.3548 22.1854 34.5773C16.0489 37.4016 10.5149 39.9485 7.44918 44.7009C4.65501 49.0325 4.90491 54.5243 5.16446 60.2284C5.37546 64.8654 5.59284 69.6426 4.18641 74.0506C-1.82264 92.8845 -1.18946 115.078 4.97405 136.013C5.18875 137.112 5.41363 138.204 5.64897 139.284C6.94998 144.086 9.49521 149.701 12.2822 155.014C15.3919 161.472 19.0581 167.64 23.2419 173.358C23.6719 174.001 23.9141 174.354 23.9141 174.354C23.9141 174.354 24.1539 174.653 24.6207 175.201C25.178 175.93 25.744 176.651 26.3186 177.364C42.3413 197.24 63.9799 209.828 86.9416 214.623C87.993 214.878 89.0443 215.11 90.0946 215.32C91.3745 215.752 92.6458 216.224 93.9185 216.697L93.9198 216.698C98.3548 218.346 102.807 220 107.699 220C112.295 220 117.19 218.364 121.913 216.785C123.954 216.103 125.963 215.431 127.902 214.907C129.892 214.516 131.874 214.064 133.843 213.551C144.038 211.077 152.535 207.099 161.557 201.866C163.681 200.486 165.745 199.02 167.749 197.47ZM18.1896 49.1087C9.22271 64.2228 4.29764 82.5587 4.16835 102.985C4.1128 111.761 6.76854 117.794 9.73711 124.537C11.3508 128.202 13.0569 132.078 14.4702 136.718C15.868 141.307 16.7836 145.13 17.6157 148.604C19.3873 155.999 20.7799 161.813 25.6403 170.077C32.4992 181.74 43.6432 192.791 56.5912 201.2C66.1636 206.863 76.6203 210.989 87.627 213.167C91.2229 213.878 94.8549 211.8 98.5471 209.687C101.826 207.811 105.153 205.907 108.544 205.907C111.678 205.907 114.806 207.874 117.899 209.817C121.317 211.966 124.692 214.088 127.983 213.494C128.049 213.482 128.116 213.47 128.182 213.458C128.242 213.447 128.301 213.436 128.36 213.425C135.708 211.742 142.705 209.32 149.278 206.216C170.537 195.257 185.373 175.584 192.551 158.956C196.934 150.563 194.336 140.222 191.696 129.711C190.031 123.084 188.349 116.388 188.389 110.071C188.349 103.859 190.907 97.7719 193.392 91.859C196.48 84.5115 199.455 77.4326 197.193 70.7161C196.709 69.5546 196.204 68.4004 195.68 67.2539C187.715 50.6288 175.339 35.6717 160.017 24.5793C148.676 17.0683 136.044 12.1512 122.944 9.21225C119.485 8.43631 115.763 9.66805 112.046 10.8979C109.007 11.9035 105.971 12.9079 103.087 12.8123C99.9148 12.7072 96.8866 11.5796 93.8831 10.4613C90.0633 9.03902 86.2834 7.63157 82.2978 8.36079C66.4087 11.2679 51.0579 16.3402 37.6822 27.1641C29.8767 33.4804 23.3831 40.9106 18.1896 49.1087Z" / > < /G> < /ClipPath> < /Defs> < G > < Circle clipPath = "url(#wave-clip)" id = "circle-bg" cx = "109" cy = "110" r = "100" fillRule = "evenodd" stroke = "#EDE9FC" strokeWidth = "50" transform = "rotate(-90 110 110)" / > < Circle clipPath = "url(#wave-clip)" id = "circle" cx = "109" cy = "110" r = "100" stroke = "url(#paint0_linear)" fill = "transparent" strokeWidth = "50" transform = "rotate(-90 110 110)" strokeDasharray = { length } strokeDashoffset = { offset } / > { withPlus && ( < Path d = "M0.783936 7.96134H8.33219V0.413086H9.56324V7.96134H17.1115V9.19239H9.56324V16.7406H8.33219V9.19239H0.783936V7.96134Z" fill = { plusColor || 'white' } transform = "scale(4) translate(18, 18)" / > ) } < /G> < Defs > < LinearGradient id = "paint0_linear" x1 = "77.8789" y1 = "53.2234" x2 = "126.388" y2 = "109.037" gradientUnits = "userSpaceOnUse" > < Stop offset = "0" stopColor = "#B39DFF" / > < Stop offset = "1" stopColor = "#7154DF" / > < /LinearGradient> < /Defs> < /Svg>); }