Skip to content

Commit

Permalink
πŸ“­πŸŽ― ↝ [SSM-65 SSG-81]: Changing unowned structure configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
Gizmotronn committed Dec 5, 2024
1 parent ffc4c39 commit 2f45439
Showing 1 changed file with 16 additions and 13 deletions.
29 changes: 16 additions & 13 deletions components/Structures/Build/EditMode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,19 @@ import { Plus } from "lucide-react";
import { Button } from "@/components/ui/button";
import { Dialog, DialogContent, DialogTitle, DialogTrigger } from "@/components/ui/dialog";
import { motion, AnimatePresence } from "framer-motion";
import { InventoryItem } from '@/types/Items';

interface InventoryItem {
id: number;
name: string;
description: string;
icon_url: string;
ItemCategory: string;
locationType?: string;
};

export function UnownedSurfaceStructures() {
const supabase = useSupabaseClient();
const session = useSession();

const { activePlanet } = useActivePlanet();

const [unownedStructures, setUnownedStructures] = useState<InventoryItem[]>([]);
Expand Down Expand Up @@ -120,9 +127,9 @@ export function UnownedSurfaceStructures() {
},
]);

if (error) {
if (error) {
throw error;
};
}

console.log(`${structure.name} has been added to the inventory.`);
setOpen(false);
Expand All @@ -133,11 +140,7 @@ export function UnownedSurfaceStructures() {
};

if (loading) {
return (
<p>
Loading...
</p>
);
return <p>Loading...</p>;
};

if (unownedStructures.length === 0) {
Expand All @@ -155,7 +158,7 @@ export function UnownedSurfaceStructures() {
<Button onClick={addResearchStation}>Add Research Station</Button>
</DialogContent>
</Dialog>
</div>
</div>
);
};

Expand All @@ -172,9 +175,9 @@ export function UnownedSurfaceStructures() {
<AnimatePresence>
{selectedStructure ? (
<motion.div
initial={{ opacity: 0, }}
animate={{ opacity: 1, }}
exit={{ opacity: 0, }}
initial={{ opacity: 0 }}
animate={{ opacity: 1 }}
exit={{ opacity: 0 }}
className="relative h-full flex flex-col items-center justify-between p-8"
>
<div className="text-center">
Expand Down

0 comments on commit 2f45439

Please sign in to comment.