import Svg, {Path, type PathProps, type SvgProps} from 'react-native-svg'

import {usePalette} from '#/lib/hooks/usePalette'

const ratio = 22 / 110.3335

export function Logotype({
  fill,
  ...rest
}: {fill?: PathProps['fill']} & SvgProps) {
  const pal = usePalette('default')
  // @ts-ignore it's fiiiiine
  const size = parseInt(rest.width || 32) * 1.5

  return (
    <Svg
      fill="none"
      viewBox="0 0 95 21"
      {...rest}
      width={size}
      height={Number(size) * ratio}>
      <Path
        fill={fill || pal.text.color}
        d="M4.31037 16.011L0 0.738281H2.9755L5.72727 11.9616H5.86896L8.80717 0.738281H11.5142L14.4599 11.9691H14.5941L17.3459 0.738281H20.3214L16.011 16.011H13.2816L10.2241 5.29474H10.1048L7.03977 16.011H4.31037Z"
      />
      <Path
        fill={fill || pal.text.color}
        d="M22.1205 16.011V4.55646H24.82V16.011H22.1205ZM23.4777 2.93075C23.0502 2.93075 22.6823 2.78906 22.374 2.50568C22.0658 2.21733 21.9117 1.8718 21.9117 1.4691C21.9117 1.06143 22.0658 0.715909 22.374 0.432528C22.6823 0.144176 23.0502 0 23.4777 0C23.9102 0 24.2781 0.144176 24.5814 0.432528C24.8896 0.715909 25.0438 1.06143 25.0438 1.4691C25.0438 1.8718 24.8896 2.21733 24.5814 2.50568C24.2781 2.78906 23.9102 2.93075 23.4777 2.93075Z"
      />
      <Path
        fill={fill || pal.text.color}
        d="M33.3159 4.55646V6.64453H26.731V4.55646H33.3159ZM28.3567 1.81215H31.0563V12.5657C31.0563 12.9286 31.111 13.207 31.2203 13.4009C31.3347 13.5898 31.4838 13.7191 31.6678 13.7887C31.8517 13.8583 32.0556 13.8931 32.2793 13.8931C32.4483 13.8931 32.6024 13.8807 32.7417 13.8558C32.8858 13.831 32.9952 13.8086 33.0698 13.7887L33.5247 15.8991C33.3805 15.9489 33.1742 16.0036 32.9057 16.0632C32.6422 16.1229 32.3191 16.1577 31.9363 16.1676C31.2601 16.1875 30.6511 16.0856 30.1092 15.8619C29.5673 15.6332 29.1373 15.2802 28.8191 14.8029C28.5059 14.3256 28.3517 13.729 28.3567 13.0131V1.81215Z"
      />
      <Path
        fill={fill || pal.text.color}
        d="M40.447 16.2347C39.3035 16.2347 38.3216 15.9837 37.5013 15.4815C36.686 14.9794 36.0571 14.2859 35.6146 13.4009C35.1771 12.511 34.9584 11.4869 34.9584 10.3285C34.9584 9.16513 35.1821 8.13849 35.6295 7.24858C36.077 6.35369 36.7084 5.65767 37.5237 5.16051C38.344 4.65838 39.3135 4.40732 40.4321 4.40732C41.3618 4.40732 42.1846 4.57884 42.9005 4.92188C43.6214 5.25994 44.1956 5.7397 44.6231 6.36115C45.0507 6.97763 45.2943 7.69851 45.354 8.52379H42.7737C42.6693 7.97195 42.4207 7.51207 42.028 7.14418C41.6402 6.77131 41.1207 6.58487 40.4694 6.58487C39.9175 6.58487 39.4328 6.73402 39.0152 7.03232C38.5976 7.32564 38.2719 7.74822 38.0383 8.30007C37.8096 8.85192 37.6952 9.51314 37.6952 10.2837C37.6952 11.0643 37.8096 11.7354 38.0383 12.2972C38.267 12.854 38.5876 13.2841 39.0003 13.5874C39.4179 13.8857 39.9076 14.0348 40.4694 14.0348C40.8671 14.0348 41.2226 13.9602 41.5358 13.8111C41.854 13.657 42.1199 13.4357 42.3337 13.1474C42.5475 12.859 42.6942 12.5085 42.7737 12.0959H45.354C45.2893 12.9062 45.0507 13.6246 44.6381 14.2511C44.2254 14.8725 43.6636 15.3597 42.9527 15.7127C42.2417 16.0607 41.4065 16.2347 40.447 16.2347Z"
      />
      <Path
        fill={fill || pal.text.color}
        d="M50.2702 9.29936V16.011H47.5707V0.738281H50.2106V6.50284H50.3448C50.6133 5.85653 51.0284 5.34695 51.5902 4.97408C52.157 4.59624 52.8778 4.40732 53.7528 4.40732C54.5483 4.40732 55.2418 4.57386 55.8335 4.90696C56.4251 5.24006 56.8825 5.72727 57.2056 6.36861C57.5337 7.00994 57.6978 7.79297 57.6978 8.71768V16.011H54.9982V9.1353C54.9982 8.3647 54.7994 7.76562 54.4016 7.33807C54.0089 6.90554 53.457 6.68928 52.7461 6.68928C52.2688 6.68928 51.8413 6.79368 51.4634 7.00249C51.0906 7.20632 50.7972 7.50213 50.5835 7.88992C50.3746 8.2777 50.2702 8.74751 50.2702 9.29936Z"
      />
      <Path
        fill={fill || pal.text.color}
        d="M69.5028 7.58416L67.0419 7.85263C66.9723 7.60405 66.8505 7.37038 66.6765 7.15163C66.5075 6.93288 66.2788 6.75639 65.9904 6.62216C65.7021 6.48793 65.3491 6.42081 64.9315 6.42081C64.3697 6.42081 63.8974 6.54261 63.5146 6.78622C63.1367 7.02983 62.9503 7.34553 62.9553 7.73331C62.9503 8.06641 63.0721 8.33736 63.3207 8.54617C63.5742 8.75497 63.9918 8.92649 64.5735 9.06073L66.5273 9.47834C67.6112 9.712 68.4165 10.0824 68.9435 10.5895C69.4755 11.0966 69.744 11.7603 69.7489 12.5806C69.744 13.3015 69.5327 13.9379 69.1151 14.4897C68.7024 15.0366 68.1282 15.4641 67.3924 15.7724C66.6566 16.0806 65.8114 16.2347 64.8569 16.2347C63.4549 16.2347 62.3264 15.9414 61.4712 15.3548C60.6161 14.7631 60.1065 13.9403 59.9425 12.8864L62.5749 12.6328C62.6942 13.1499 62.9478 13.5401 63.3356 13.8036C63.7234 14.0671 64.228 14.1989 64.8494 14.1989C65.4908 14.1989 66.0053 14.0671 66.3931 13.8036C66.7859 13.5401 66.9822 13.2145 66.9822 12.8267C66.9822 12.4986 66.8555 12.2276 66.6019 12.0138C66.3533 11.8001 65.9656 11.636 65.4386 11.5217L63.4847 11.1115C62.386 10.8828 61.5732 10.4975 61.0462 9.95561C60.5192 9.40874 60.2582 8.71769 60.2631 7.88246C60.2582 7.17649 60.4496 6.56499 60.8374 6.04794C61.2301 5.52592 61.7745 5.12322 62.4705 4.83984C63.1715 4.55149 63.9794 4.40732 64.8942 4.40732C66.2365 4.40732 67.293 4.69318 68.0636 5.26492C68.8391 5.83665 69.3189 6.60973 69.5028 7.58416Z"
      />
      <Path
        fill={fill || pal.text.color}
        d="M74.4359 12.4165L74.4284 9.15767H74.861L78.9774 4.55646H82.1319L77.0684 10.1942H76.5091L74.4359 12.4165ZM71.975 16.011V0.738281H74.6745V16.011H71.975ZM79.1639 16.011L75.4352 10.7983L77.2548 8.89666L82.3929 16.011H79.1639Z"
      />
      <Path
        fill={fill || pal.text.color}
        d="M85.732 20.3065C85.3641 20.3065 85.0235 20.2766 84.7103 20.217C84.4021 20.1623 84.156 20.0977 83.972 20.0231L84.5985 17.9201C84.9912 18.0344 85.3417 18.0891 85.6499 18.0842C85.9582 18.0792 86.2291 17.9822 86.4628 17.7933C86.7014 17.6094 86.9028 17.3011 87.0668 16.8686L87.298 16.2496L83.1443 4.55646H86.0079L88.6478 13.207H88.7671L91.4145 4.55646H94.2856L89.6993 17.3981C89.4855 18.0046 89.2021 18.5241 88.8492 18.9567C88.4962 19.3942 88.0637 19.7273 87.5516 19.956C87.0445 20.1896 86.4379 20.3065 85.732 20.3065Z"
      />
    </Svg>
  )
}
