1- ' use client' ;
1+ " use client" ;
22
3- import GameNavbar from "@/components/Layout/Tes" ;
4- import TotalPoints from "@/components/Structures/Missions/Stardust/Total" ;
5- import { AdvancedTechTreeComponent } from "@/components/Structures/Research/OldTechTree" ;
3+ import { ArrowRight , Lock , Telescope , Cloud , Leaf } from "lucide-react" ;
4+ import { useState } from "react" ;
65import { Button } from "@/components/ui/button" ;
7- import MySettlementsLocations from "@/content/Classifications/UserLocations" ;
8- import React , { useEffect , useState } from "react" ;
6+ import { StatCard } from "@/components/Research/StatCard" ;
7+ import { TechSection } from "@/components/Research/TechSection" ;
8+ import { UpgradeItem } from "@/components/Research/UpgradeItem" ;
9+ import { LockedItem } from "@/components/Research/LockedItem" ;
10+ import GameNavbar from "@/components/Layout/Tes" ;
11+ import AstronomyResearch from "@/components/Research/AstronomyItems" ;
12+
13+ type CapacityKey =
14+ | "probeCount"
15+ | "probeDistance"
16+ | "stationCount"
17+ | "balloonCount"
18+ | "cameraCount"
19+ | "stationSize" ;
20+
21+ type UserCapacities = Record < CapacityKey , number > ;
922
1023export default function TechTreeResearchPage ( ) {
11- return (
12- < div className = "relative w-full py-10 bg-black text-white" >
13- < GameNavbar />
14- Available: < TotalPoints />
15- < h2 className = "text-lg text-white" > Available upgrades</ h2 >
16- < h3 className = "text-md text-white" > Astronomy</ h3 >
17- < Button
18- variant = 'ghost'
19- >
20- Probecount ++
21- </ Button >
22- < h3 className = "text-md text-white" > Meteorology</ h3 >
23- < Button
24- variant = 'ghost'
25- >
26- Probecount ++
27- </ Button >
28- < h3 className = "text-md text-white" > Biology</ h3 >
29- < Button
30- variant = 'ghost'
31- >
32- Cameracount++
33- </ Button >
34- < Button
35- variant = 'ghost'
36- >
37- Station Count - select [show available/ready]
38- </ Button >
39- < h2 className = "text-lg text-white" > [temporarily] Unavailable upgrades</ h2 >
40- < h3 className = "text-md text-white" > Astronomy</ h3 >
41- < Button
42- variant = 'ghost'
24+ const [ availablePoints , setAvailablePoints ] = useState ( 10 ) ;
25+ const [ userCapacities , setUserCapacities ] = useState < UserCapacities > ( {
26+ probeCount : 1 ,
27+ probeDistance : 1 ,
28+ stationCount : 0 ,
29+ balloonCount : 0 ,
30+ cameraCount : 1 ,
31+ stationSize : 0 ,
32+ } ) ;
33+
34+ const getUpgradeCost = ( currentLevel : number ) : number => {
35+ return ( currentLevel + 1 ) * 2 ;
36+ } ;
37+
38+ const handleUpgrade = ( capacity : CapacityKey , currentLevel : number ) => {
39+ const cost = getUpgradeCost ( currentLevel ) ;
40+ if ( availablePoints >= cost ) {
41+ setAvailablePoints ( ( prev ) => prev - cost ) ;
42+ setUserCapacities ( ( prev ) => ( {
43+ ...prev ,
44+ [ capacity ] : prev [ capacity ] + 1 ,
45+ } ) ) ;
46+ }
47+ } ;
48+
49+ return (
50+ < div className = "min-h-screen bg-[#0a1929] flex flex-col" >
51+ < div className = "fixed top-0 left-0 right-0 z-50" >
52+ < GameNavbar />
53+ </ div >
54+
55+ < div className = "flex-1 pt-20 text-[#c5d5e6] font-mono" >
56+ < header className = "bg-[#0a1929] border-b border-[#1e3a5f] py-12 p-4" >
57+ < div className = "container mx-auto flex justify-between items-center" >
58+ < h1 className = "text-2xl font-bold text-[#4cc9f0] tracking-wider" > RESEARCH LAB</ h1 >
59+ < div className = "flex items-center gap-4" >
60+ < div className = "flex items-center gap-2 bg-[#0f2942] px-4 py-2 rounded border border-[#1e3a5f]" >
61+ < span className = "text-[#4cc9f0]" > STARDUST:</ span >
62+ < span className = "font-bold text-[#f72585] text-xl" > { availablePoints } </ span >
63+ </ div >
64+ </ div >
65+ </ div >
66+ </ header >
67+
68+ < main className = "container mx-auto p-4" >
69+ { /* <div className="grid grid-cols-3 gap-4 mb-8">
70+ <StatCard title="PROBE COUNT" value={userCapacities.probeCount} max={3} color="#4361ee" />
71+ <StatCard title="PROBE DISTANCE" value={userCapacities.probeDistance * 1000} color="#4cc9f0" />
72+ <StatCard title="CAMERA COUNT" value={userCapacities.cameraCount} max={3} color="#3a0ca3" />
73+ </div> */ }
74+
75+ < div className = "relative" >
76+ { /* <div className="absolute inset-0 z-0">
77+ <div className="absolute left-[50%] top-[120px] w-[2px] h-[100px] bg-[#1e3a5f]"></div>
78+ <div className="absolute left-[50%] top-[340px] w-[2px] h-[100px] bg-[#1e3a5f]"></div>
79+ </div> */ }
80+
81+ < AstronomyResearch />
82+
83+ < TechSection
84+ title = "METEOROLOGY"
85+ icon = { < Cloud /> }
86+ color = "#4cc9f0"
87+ glowColor = "rgba(76, 201, 240, 0.5)"
4388 >
44- Probedistance ++
45- </ Button >
46- < h3 className = "text-md text-white" > Meteorology</ h3 >
47- < MySettlementsLocations /> - Show weather balloons on Settlements
48- < h3 className = "text-md text-white" > Biology</ h3 >
49- < Button
50- variant = 'ghost'
89+ < div className = "space-y-6" >
90+ < div >
91+ < h3 className = "text-lg font-semibold text-[#4cc9f0] mb-4 border-b border-[#1e3a5f] pb-2" >
92+ AVAILABLE UPGRADES
93+ </ h3 >
94+ < UpgradeItem
95+ title = "Balloon Count ++"
96+ description = "Add weather balloons to monitor atmospheric conditions"
97+ current = { userCapacities . balloonCount }
98+ max = { 3 }
99+ cost = { getUpgradeCost ( userCapacities . balloonCount ) }
100+ onUpgrade = { ( ) => handleUpgrade ( "balloonCount" , userCapacities . balloonCount ) }
101+ disabled = {
102+ userCapacities . balloonCount >= 3 ||
103+ availablePoints < getUpgradeCost ( userCapacities . balloonCount )
104+ }
105+ color = "#4cc9f0"
106+ />
107+ </ div >
108+
109+ < div >
110+ < h3 className = "text-lg font-semibold text-[#8badc9] mb-4 border-b border-[#1e3a5f] pb-2" >
111+ UNAVAILABLE UPGRADES
112+ </ h3 >
113+ < LockedItem
114+ title = "Weather Balloons on Settlements"
115+ description = "Deploy weather monitoring on your settlements"
116+ />
117+ </ div >
118+ </ div >
119+ </ TechSection >
120+
121+ < TechSection
122+ title = "BIOLOGY"
123+ icon = { < Leaf /> }
124+ color = "#7209b7"
125+ glowColor = "rgba(114, 9, 183, 0.5)"
51126 >
52- Heat/Motion Sensors ++
53- </ Button >
54- { /* <AdvancedTechTreeComponent /> */ }
55- </ div >
56- ) ;
127+ < div className = "space-y-6" >
128+ < div >
129+ < h3 className = "text-lg font-semibold text-[#4cc9f0] mb-4 border-b border-[#1e3a5f] pb-2" >
130+ AVAILABLE UPGRADES
131+ </ h3 >
132+ < div className = "space-y-4" >
133+ < UpgradeItem
134+ title = "Camera Count ++"
135+ description = "Increase observation capabilities"
136+ current = { userCapacities . cameraCount }
137+ max = { 3 }
138+ cost = { getUpgradeCost ( userCapacities . cameraCount ) }
139+ onUpgrade = { ( ) => handleUpgrade ( "cameraCount" , userCapacities . cameraCount ) }
140+ disabled = {
141+ userCapacities . cameraCount >= 3 ||
142+ availablePoints < getUpgradeCost ( userCapacities . cameraCount )
143+ }
144+ color = "#7209b7"
145+ />
146+
147+ < div className = "bg-[#0a1929] border border-[#1e3a5f] p-4 rounded-md" >
148+ < div className = "flex items-center justify-between" >
149+ < div >
150+ < p className = "font-medium text-white" > Station Count</ p >
151+ < p className = "text-[#8badc9] mt-1 text-sm" >
152+ View available biodome stations
153+ </ p >
154+ </ div >
155+ < Button
156+ className = "bg-[#7209b7] hover:bg-opacity-90 text-white border-[#1e3a5f]"
157+ style = { { boxShadow : "0 0 10px rgba(114, 9, 183, 0.3)" } }
158+ >
159+ SHOW AVAILABLE
160+ </ Button >
161+ </ div >
162+ </ div >
163+ </ div >
164+ </ div >
165+
166+ < div >
167+ < h3 className = "text-lg font-semibold text-[#8badc9] mb-4 border-b border-[#1e3a5f] pb-2" >
168+ UNAVAILABLE UPGRADES
169+ </ h3 >
170+ < LockedItem
171+ title = "Station Size ++"
172+ description = "Expand the size of your research stations"
173+ />
174+ </ div >
175+ </ div >
176+ </ TechSection >
177+ </ div >
178+ </ main >
179+ </ div >
180+ </ div >
181+ ) ;
57182} ;
0 commit comments