-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
217 add uv data on satellite page (#248)
* Zustand on satellite select #217 * UV data #217
- Loading branch information
EliasKnudsen
authored and
GitHub
committed
Apr 9, 2024
1 parent
14f997a
commit 103889b
Showing
4 changed files
with
102 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| "use client"; | ||
| import React from "react"; | ||
| import Image from "next/image"; | ||
| import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; | ||
| import SatelliteStatsTable from "@/components/satelliteData/SatelliteStatsTable"; | ||
| // Import OuiImage or your placeholder image component here | ||
| import { OuiImage } from "@/components/fullBlogCard"; | ||
| //import { useSatelliteStore } from "@/lib/store"; | ||
|
|
||
| interface SatelliteCardProps { | ||
| satelliteName: string; | ||
| missionStatus: string; | ||
| previewImage?: string; // Optional | ||
| } | ||
|
|
||
| const SatelliteCard: React.FC<SatelliteCardProps> = ({ | ||
| satelliteName, | ||
| missionStatus, | ||
| previewImage, | ||
| }) => { | ||
| /*const setSelectedSatellite = useSatelliteStore( | ||
| (state) => state.setSelectedSatellite, | ||
| );*/ | ||
|
|
||
| const handleSatelliteCardClick = (satelliteName: string) => () => { | ||
| //setSelectedSatellite(satelliteName); | ||
| window.location.href = `/satellites/${encodeURIComponent(satelliteName)}`; | ||
| }; | ||
|
|
||
| return ( | ||
| <div | ||
| onClick={handleSatelliteCardClick(satelliteName)} | ||
| className="w-1/1.5 m-1 transition-transform duration-300 ease-in-out hover:scale-110 hover:transform sm:m-4 md:w-1/3" | ||
| > | ||
| {" "} | ||
| {/* Ensure the link is clickable and accessible */} | ||
| <Card className="flex h-full w-full flex-col"> | ||
| <CardHeader className="flex flex-col items-center justify-center"> | ||
| <CardTitle>{satelliteName}</CardTitle> | ||
| </CardHeader> | ||
| <CardContent className="flex flex-col items-center"> | ||
| <SatelliteStatsTable | ||
| satName={satelliteName} | ||
| missionStatus={missionStatus} | ||
| /> | ||
| {previewImage ? ( | ||
| <Image | ||
| src={previewImage} | ||
| alt={satelliteName} | ||
| width={200} | ||
| height={200} | ||
| className="margin p-2" | ||
| /> | ||
| ) : ( | ||
| <div className="m-0 flex aspect-video max-h-full max-w-full items-center justify-center object-contain"> | ||
| <OuiImage /> | ||
| </div> | ||
| )} | ||
| </CardContent> | ||
| </Card> | ||
| </div> | ||
| ); | ||
| }; | ||
|
|
||
| export default SatelliteCard; |