diff --git a/app/posts/[id]/page.tsx b/app/posts/[id]/page.tsx index ec2badca..0873a271 100644 --- a/app/posts/[id]/page.tsx +++ b/app/posts/[id]/page.tsx @@ -4,6 +4,7 @@ import React, { useEffect, useState } from "react"; import { useSupabaseClient } from "@supabase/auth-helpers-react"; import { SimplePostSingle } from "@/content/Posts/SimplePostSingle"; import StructuresOnPlanet from "@/components/Structures/Structures"; +import PlanetGenerator from "@/components/Data/Generator/Astronomers/PlanetHunters/PlanetGenerator"; interface Classification { id: number; @@ -13,13 +14,12 @@ interface Classification { anomaly: number | null; media: string[] | null; classificationtype: string | null; + classificationConfig?: any | null; }; export default function SinglePostPage({ params }: { params: { id: string } }) { const supabase = useSupabaseClient(); - const [classification, setClassification] = useState( - null - ); + const [classification, setClassification] = useState(null); const [loading, setLoading] = useState(true); const [error, setError] = useState(null); @@ -91,14 +91,14 @@ export default function SinglePostPage({ params }: { params: { id: string } }) {
{classification.author && (
- +
)} diff --git a/components/Data/Generator/Astronomers/PlanetHunters/PlanetGenerator.tsx b/components/Data/Generator/Astronomers/PlanetHunters/PlanetGenerator.tsx index f7a89441..f8eb0a86 100644 --- a/components/Data/Generator/Astronomers/PlanetHunters/PlanetGenerator.tsx +++ b/components/Data/Generator/Astronomers/PlanetHunters/PlanetGenerator.tsx @@ -17,7 +17,7 @@ interface PlanetGeneratorProps { export default function PlanetGenerator({ classificationConfig, author, classificationId }: PlanetGeneratorProps) { const supabase = useSupabaseClient(); - const session = useSession(); + const session = useSession(); const initialMass = classificationConfig?.exportedValue?.mass ?? 1; const initialRadius = classificationConfig?.exportedValue?.radius ?? 1; diff --git a/components/Projects/(classifications)/Annotating/Annotator.tsx b/components/Projects/(classifications)/Annotating/Annotator.tsx index d8a03316..a4ea9617 100644 --- a/components/Projects/(classifications)/Annotating/Annotator.tsx +++ b/components/Projects/(classifications)/Annotating/Annotator.tsx @@ -27,6 +27,7 @@ interface ImageAnnotatorProps { missionNumber: number; assetMentioned: string | string[]; structureItemId?: number; + parentPlanetLocation?: string; annotationType: 'AI4M' | 'P4' | 'PH' | 'Custom'; }; @@ -36,6 +37,7 @@ export default function ImageAnnotator({ anomalyId, missionNumber, assetMentioned, + parentPlanetLocation, structureItemId, annotationType, }: ImageAnnotatorProps) { @@ -81,7 +83,7 @@ export default function ImageAnnotator({ console.error('Unexpected error during canvas upload:', err); } finally { setIsUploading(false); - } + }; }; useEffect(() => { @@ -117,22 +119,21 @@ export default function ImageAnnotator({
- + canvasRef={canvasRef} + imageRef={imageRef} + isDrawing={isDrawing} + setIsDrawing={setIsDrawing} + currentTool={currentTool} + currentColor={ + CATEGORY_CONFIG[currentCategory as keyof typeof CATEGORY_CONFIG]?.color || '#000000' + } + lineWidth={lineWidth} + drawings={drawings} + setDrawings={setDrawings} + currentDrawing={currentDrawing} + setCurrentDrawing={setCurrentDrawing} + currentCategory={currentCategory} + /> = ({ anomalyId, missionNumber, assetMentioned, + parentPlanetLocation, structureItemId, }) => { const supabase = useSupabaseClient(); @@ -230,6 +231,7 @@ const ClassificationForm: React.FC = ({ const classificationConfiguration = { classificationOptions: classificationOptionsObj, additionalFields, + parentPlanetLocation: parentPlanetLocation || null, activePlanet: activePlanet?.id, createdBy: inventoryItemId ?? null, }; diff --git a/components/Projects/Satellite/PlanetFour.tsx b/components/Projects/Satellite/PlanetFour.tsx index 2cfc35c2..bf02070e 100644 --- a/components/Projects/Satellite/PlanetFour.tsx +++ b/components/Projects/Satellite/PlanetFour.tsx @@ -222,6 +222,7 @@ export function PlanetFourProject({ anomalyid }: SelectedAnomProps) { structureItemId={3103} annotationType="P4" initialImageUrl={imageUrl} + parentPlanetLocation={anomalyid?.toString()} /> )} {imageUrl} diff --git a/components/Structures/Missions/PickPlanet.tsx b/components/Structures/Missions/PickPlanet.tsx index 62b632e8..c0a8fbee 100644 --- a/components/Structures/Missions/PickPlanet.tsx +++ b/components/Structures/Missions/PickPlanet.tsx @@ -3,6 +3,8 @@ import React, { useEffect, useState } from "react"; import { useSession, useSupabaseClient } from "@supabase/auth-helpers-react"; import { PostCardSingle } from "@/content/Posts/PostSingle"; +import { SimplePostSingle } from "@/content/Posts/SimplePostSingle"; +import { SciFiButton } from "@/components/ui/styles/sci-fi/button"; interface Classification { id: number; @@ -11,6 +13,7 @@ interface Classification { author: string; anomaly: number | null; media?: any | null; + classificationType: string | null; classificationConfiguration: any | null; planetType: string | null; images?: string[]; @@ -90,29 +93,38 @@ interface PreferredTerrestrialClassificationsProps { ) : ( classifications.map((classification) => (
- - + + {/* */} + onSelectAnomaly(classification.anomaly)} + className="mt-2 text-blue-500" + > + Search this planet for anomalies to investigate +
- )) + )) )}
); diff --git a/content/Posts/SimplePostSingle.tsx b/content/Posts/SimplePostSingle.tsx index 3717c774..8a3d80b5 100644 --- a/content/Posts/SimplePostSingle.tsx +++ b/content/Posts/SimplePostSingle.tsx @@ -5,6 +5,7 @@ import StructuresOnPlanet from '@/components/Structures/Structures'; import { AvatarGenerator } from '@/components/Account/Avatar'; import { Button } from '@/components/ui/button'; import { Share2 } from 'lucide-react'; +import PlanetGenerator from '@/components/Data/Generator/Astronomers/PlanetHunters/PlanetGenerator'; interface SimplePostSingleProps { title: string; @@ -13,6 +14,7 @@ interface SimplePostSingleProps { content: string; category: string; images: string[]; + classificationConfiguration?: any; }; export function SimplePostSingle({ @@ -22,6 +24,7 @@ export function SimplePostSingle({ content, category, images, + classificationConfiguration, }: SimplePostSingleProps) { const [currentIndex, setCurrentIndex] = useState(0); @@ -55,9 +58,8 @@ export function SimplePostSingle({ }; return ( -
+
- {/* Share Button Positioned in the Top Right */}
)} + {/* */}