@@ -11,26 +11,23 @@ import Junimo2 from '../../Media/Junimo2B.png'
1111import Junimo3 from '../../Media/Junimo3B.png'
1212import Junimo4 from '../../Media/Junimo4B.png'
1313import Rope from '../../Media/Rope.png'
14- import type { fullPlayerDataType } from 'types/displayDataTypes' ;
14+ import type { formattedSaveFileType , fullPlayerDataType } from 'types/displayDataTypes' ;
1515
16- type statsPageProps = {
17- playerData : fullPlayerDataType ;
18- globalFarmName : string ;
19- farmhands : fullPlayerDataType [ ] ;
20- }
2116
22- const Stats = ( { playerData, globalFarmName, farmhands} : statsPageProps ) => {
23- const [ farmName ] = useState ( globalFarmName || "My Farm" ) ;
17+
18+ const Stats = ( { playerData, farmName, farmhandData} : formattedSaveFileType ) => {
19+ const [ globalFarmName ] = useState ( farmName || "My Farm" ) ;
2420 const [ junimos ] = useState ( [ Junimo1 , Junimo2 , Junimo3 , Junimo4 ] ) ;
2521 const [ Activejunimos ] = useState ( [ Junimo1a , Junimo2a , Junimo3a , Junimo4a ] ) ;
2622
27- const titles = farmhands . map ( ( item , i ) =>
23+ const titles = farmhandData . map ( ( item , i ) =>
2824 < Tab key = { i } >
2925 < img src = { junimos [ i + 1 ] } alt = "Jun" > </ img > { item . playerName }
3026 </ Tab >
3127 ) ;
28+
3229
33- const playerStats = farmhands . map ( ( item , i ) => (
30+ const playerStats = farmhandData . map ( ( item , i ) => (
3431 < TabPanel key = { i } >
3532 < section className = "wrapper" >
3633 < Skills { ...item . experience } > </ Skills >
@@ -55,42 +52,46 @@ const Stats = ({playerData, globalFarmName, farmhands}: statsPageProps) => {
5552 </ section >
5653 </ TabPanel >
5754 ) ) ;
58-
55+ console . log ( "Rendering Stats component with playerData:" , playerData , "experience:" , playerData . experience ) ;
5956 return (
6057 < div className = "file-container" >
61- < div className = "farmName" > < h2 > Farm: { farmName } </ h2 > </ div >
58+ < div className = "farmName" > < h2 > Farm: { globalFarmName } </ h2 > </ div >
6259 < section className = "scroller" >
60+ { playerData ? (
6361 < Tabs >
6462 < TabList >
65- < Tab > < img src = { junimos [ 0 ] } alt = "Junimo" width = "25px" > </ img > { playerData [ 0 ] . playerName } </ Tab >
63+ < Tab > < img src = { junimos [ 0 ] } alt = "Junimo" width = "25px" > </ img > { playerData . playerName } </ Tab >
6664 { titles }
6765 </ TabList >
6866
6967 < TabPanel >
7068 < section className = "wrapper" >
71- < Skills { ...playerData [ 0 ] . experience } > </ Skills >
69+ < >
70+ < Skills experience = { playerData . experience } > </ Skills >
7271 < div className = "ropes" >
7372 < img src = { Rope } alt = "" > </ img >
7473 < img src = { Rope } alt = "" > </ img >
7574 </ div >
7675 < Achievements
77- recipesCooked = { playerData [ 0 ] . cookedItems }
78- itemsCrafted = { playerData [ 0 ] . itemsCrafted }
79- cropsShipped = { playerData [ 0 ] . cropsShipped }
80- fishCaught = { playerData [ 0 ] . fishCaught }
81- friendship = { playerData [ 0 ] . friendship }
82- monstersKilled = { playerData [ 0 ] . monstersKilled }
83- shippedItems = { playerData [ 0 ] . shippedItems }
84- moneyEarned = { playerData [ 0 ] . moneyEarned }
85- museumCollection = { playerData [ 0 ] . museumCollection }
86- questsDone = { playerData [ 0 ] . questsDone }
87- specialReq = { playerData [ 0 ] . specialRequests }
88- pendingSpecialReq = { playerData [ 0 ] . pendingSpecialRequests }
89- > </ Achievements >
76+ recipesCooked = { playerData . cookedItems }
77+ itemsCrafted = { playerData . itemsCrafted }
78+ cropsShipped = { playerData . cropsShipped }
79+ fishCaught = { playerData . fishCaught }
80+ friendship = { playerData . friendship }
81+ monstersKilled = { playerData . monstersKilled }
82+ shippedItems = { playerData . shippedItems }
83+ moneyEarned = { playerData . moneyEarned }
84+ museumCollection = { playerData . museumCollection }
85+ questsDone = { playerData . questsDone }
86+ specialReq = { playerData . specialRequests }
87+ //pendingSpecialReq={playerData.pendingSpecialRequests}
88+ > </ Achievements >
89+ </ >
9090 </ section >
9191 </ TabPanel >
9292 { playerStats }
93- </ Tabs >
93+ </ Tabs > ) : < p > No player data available.</ p >
94+ }
9495 </ section >
9596 </ div >
9697 ) ;
0 commit comments