DogBody.tsx 3.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. import React from 'react';
  2. const DogBody = ({
  3. onPathClick,
  4. selectedId,
  5. }: {
  6. onPathClick: (id: string) => void;
  7. selectedId: string | null;
  8. }) => {
  9. return (
  10. <svg viewBox="0 0 540 471" width="100%">
  11. <path
  12. id="Dog_Skull"
  13. d="M145.4,92.7L123.29999,70.599997 105.7,26.600002 96.899998,37.000001 88.099994,25.800002 80.89999,63.4 65.699994,76.199998 51.299997,87.399997 37.7,98.599996 21.700002,105.8 7.3000037,113.79999 6.5000036,128.19999 18.500003,139.4 24.900003,147.39999 39.300001,150.59999 56.9,151.39999 76.899999,145.79999 90.499998,148.99999z"
  14. fill={selectedId === 'Dog_Skull' ? '#f5222d' : '#ccc'}
  15. stroke={selectedId === 'Dog_Skull' ? '#ff4d4f' : '#ccc'}
  16. strokeWidth={2}
  17. style={{ cursor: 'pointer' }}
  18. onClick={() => onPathClick('Dog_Skull')}
  19. />
  20. <path
  21. id="Dog_Spine"
  22. d="M119.8,126.3L198.5,175.4 286.5,175.4 374.5,174.60001 372.1,139.4 296.1,138.6 201.7,136.2 146.5,93.799999 121.7,121"
  23. fill={selectedId === 'Dog_Spine' ? '#f5222d' : '#ccc'}
  24. stroke={selectedId === 'Dog_Spine' ? '#ff4d4f' : '#ccc'}
  25. strokeWidth={2}
  26. style={{ cursor: 'pointer' }}
  27. onClick={() => onPathClick('Dog_Spine')}
  28. />
  29. <path
  30. id="Dog_FrontExtremities"
  31. d="M86.2,157.5L122.5,209 139.3,252.2 153.7,277.8 170.50002,288.99999 182.50002,360.2 184.10002,400.20001 181.70002,417.00001 155.30001,428.2 155.30001,441.80001 185.70002,445.00002 200.90003,425.80003 212.10004,421.00003 224.10004,388.20002 225.70004,293.80001 199.30003,178.6 115.30001,125 88.099998,152.2"
  32. fill={selectedId === 'Dog_FrontExtremities' ? '#f5222d' : '#ccc'}
  33. stroke={selectedId === 'Dog_FrontExtremities' ? '#ff4d4f' : '#ccc'}
  34. strokeWidth={2}
  35. style={{ cursor: 'pointer' }}
  36. onClick={() => onPathClick('Dog_FrontExtremities')}
  37. />
  38. <path
  39. id="Dog_Thorax"
  40. d="M202.2,176.7L290.5,181 308.9,274.60007 226.5,293.80008z"
  41. fill={selectedId === 'Dog_Thorax' ? '#f5222d' : '#ccc'}
  42. stroke={selectedId === 'Dog_Thorax' ? '#ff4d4f' : '#ccc'}
  43. strokeWidth={2}
  44. style={{ cursor: 'pointer' }}
  45. onClick={() => onPathClick('Dog_Thorax')}
  46. />
  47. <path
  48. id="Dog_Abdomen"
  49. d="M291.8,179.9L377.69999,177.79999 396.89998,253.00021 312.89999,275.40028z"
  50. fill={selectedId === 'Dog_Abdomen' ? '#f5222d' : '#ccc'}
  51. stroke={selectedId === 'Dog_Abdomen' ? '#ff4d4f' : '#ccc'}
  52. strokeWidth={2}
  53. style={{ cursor: 'pointer' }}
  54. onClick={() => onPathClick('Dog_Abdomen')}
  55. />
  56. <path
  57. id="Dog_Hip"
  58. d="M372.6,142.3L398.50001,253 495.29998,225 486.49999,185 508.89999,169 528.89999,143.4 536.89996,109 532.09996,84.200009 512.89997,57.800014 488.89998,38.600016 468.89998,30.600018 486.49998,57.800015 500.09997,87.400013 508.09997,113.80001 495.29997,124.20001 472.09998,138.60001 440.09999,144.20001 373.70001,137.80001"
  59. fill={selectedId === 'Dog_Hip' ? '#f5222d' : '#ccc'}
  60. stroke={selectedId === 'Dog_Hip' ? '#ff4d4f' : '#ccc'}
  61. strokeWidth={2}
  62. style={{ cursor: 'pointer' }}
  63. onClick={() => onPathClick('Dog_Hip')}
  64. />
  65. <path
  66. id="Dog_RearExtremities"
  67. d="M401.4,257.5L498.49999,228.2 499.3,309.00001 525.37726,349.00985 521.80024,440.19984 488.60743,438.70827 490.60017,415.39986 467.38135,428.48481 448.28146,415.68482 470.49999,401.79997 475.40014,378.59998 466.49999,344.99998 436.89999,313.79999z"
  68. fill={selectedId === 'Dog_RearExtremities' ? '#f5222d' : '#ccc'}
  69. stroke={selectedId === 'Dog_RearExtremities' ? '#ff4d4f' : '#ccc'}
  70. strokeWidth={2}
  71. style={{ cursor: 'pointer' }}
  72. onClick={() => onPathClick('Dog_RearExtremities')}
  73. />
  74. </svg>
  75. );
  76. };
  77. export default DogBody;