@@ -8,41 +8,38 @@ import { useModalStore } from '~stores/modalStore'
88import EditDogProfileModal from '~modals/EditDogProfileModal'
99import { calculateAge } from '~utils/calculateAge'
1010
11- export default function DogProfile ( {
12- dogId,
13- name,
14- gender,
15- profileImg,
16- birthDate,
17- breed,
18- comment,
19- isNeutered,
20- weight,
21- } : DogProfileType ) {
22- const age = calculateAge ( birthDate ! )
11+ interface DogProfileProps {
12+ dogProfile : DogProfileType
13+ isEditBtnVisible ?: boolean
14+ }
15+
16+ export default function DogProfile ( { dogProfile, isEditBtnVisible = false } : DogProfileProps ) {
17+ const age = calculateAge ( dogProfile . birthDate ! )
2318 const { pushModal } = useModalStore ( )
2419 return (
2520 < S . DogInfoArea >
2621 < S . DogInfoWrapper >
27- < S . EditIconWrapper onClick = { ( ) => pushModal ( < EditDogProfileModal dogId = { dogId } /> ) } >
28- < MdOutlineModeEdit size = { 20 } />
29- </ S . EditIconWrapper >
30- < Profile $size = { 80 } $src = { profileImg || '' } />
22+ { isEditBtnVisible && (
23+ < S . EditIconWrapper onClick = { ( ) => pushModal ( < EditDogProfileModal dogId = { dogProfile . dogId } /> ) } >
24+ < MdOutlineModeEdit size = { 20 } />
25+ </ S . EditIconWrapper >
26+ ) }
27+ < Profile $size = { 80 } $src = { dogProfile . profileImg || '' } />
3128 < S . DogDetailWrapper >
3229 < S . TypoWrapper >
3330 < S . TyopNameWrapper >
34- < Typo20 $weight = '700' > { name } </ Typo20 >
31+ < Typo20 $weight = '700' > { dogProfile . name } </ Typo20 >
3532 </ S . TyopNameWrapper >
36- < Typo15 $weight = '400' > { breed } </ Typo15 >
33+ < Typo15 $weight = '400' > { dogProfile . breed } </ Typo15 >
3734 < Separator $height = { 8 } />
3835 < Typo15 $weight = '400' > { age } μ΄</ Typo15 >
3936 < Separator $height = { 8 } />
40- < Typo15 $weight = '400' > { gender === 'MALE' ? 'λ¨' : 'μ¬' } </ Typo15 >
37+ < Typo15 $weight = '400' > { dogProfile . gender === 'MALE' ? 'λ¨' : 'μ¬' } </ Typo15 >
4138 </ S . TypoWrapper >
4239 < S . DogDetailInfoWrapper >
43- < Typo14 $weight = '400' > μ€μ±ν { isNeutered === 'TRUE' ? 'O' : 'X' } </ Typo14 >
40+ < Typo14 $weight = '400' > μ€μ±ν { dogProfile . isNeutered === 'TRUE' ? 'O' : 'X' } </ Typo14 >
4441 < Separator $height = { 8 } />
45- < Typo14 $weight = '400' > { weight } KG</ Typo14 >
42+ < Typo14 $weight = '400' > { dogProfile . weight } KG</ Typo14 >
4643 </ S . DogDetailInfoWrapper >
4744 </ S . DogDetailWrapper >
4845 </ S . DogInfoWrapper >
@@ -51,7 +48,7 @@ export default function DogProfile({
5148 μ°λ¦¬ λλμ΄λ₯Ό μκ°ν΄μ!
5249 </ Typo15 >
5350 < Typo13 $weight = '500' style = { { lineHeight : 1.2 } } >
54- { comment }
51+ { dogProfile . comment }
5552 </ Typo13 >
5653 </ S . OneLineIntro >
5754 </ S . DogInfoArea >
0 commit comments