diff --git a/components/personacontext.tsx b/components/personacontext.tsx index e1ae6a9..d6c92a8 100644 --- a/components/personacontext.tsx +++ b/components/personacontext.tsx @@ -5,58 +5,33 @@ export const PersonaContext = createContext(null); export const PersonaProvider = ({ children }) => { const [personas, setPersonas] = useState([]); - const [error, setError] = useState(null); - const getPersonas = async () => { - fetch("/api/personas?personaToQuery=all") - .then((response) => response.json()) - .then((data) => { - setPersonas(data); - }) - .catch((error) => { - setError(error.message); - }); - } - - const addPersona = async (newPersona) => { - fetch('/api/personas', { - method: 'POST', - headers: { - 'Content-Type': 'application/json', + const getPersonas = () => { + const starterPersonas = [ + { + personaname: "Cody", + personatype: "Standard User", + personaimage: "standard.jpg", + personaemail: "cody@launchmail.io", }, - body: JSON.stringify(newPersona), - }) - .then(response => response.json()) - .then(data => { - if (data && data.error) { - setError(data.error); - } else { - setPersonas(prevPersonas => [...prevPersonas, data]); - } - }) - .catch(error => { - setError('Failed to create new persona. Please try again.'); - }); - }; - - const deleteAllPersonas = async () => { - fetch('/api/personas', { - method: 'DELETE', - }) - .then(response => { - if (response.ok) { - setPersonas([]); - } else { - throw new Error('Failed to delete all personas'); - } - }) - .catch(error => { - setError(error.message); - }); + { + personaname: "Alysha", + personatype: "Beta User", + personaimage: "beta.png", + personaemail: "alysha@launchmail.io", + }, + { + personaname: "Jenn", + personatype: "Developer", + personaimage: "woman.png", + personaemail: "jenn@launchmail.io", + }, + ]; + setPersonas(starterPersonas); }; return ( - + {children} ); diff --git a/components/ui/logincomponent.tsx b/components/ui/logincomponent.tsx index d7eb12f..7ec53e9 100644 --- a/components/ui/logincomponent.tsx +++ b/components/ui/logincomponent.tsx @@ -28,7 +28,7 @@ export function LoginComponent({ isLoggedIn, setIsLoggedIn, loginUser, name }: L const marketButtonColorClass = "bg-gradient-to-r from-marketblue text-black to-marketgreen text-black"; const [newPersona, setNewPersona] = useState({ name: '', type: '', image: '', email: '' }); - const { personas, addPersona, deleteAllPersonas, getPersonas } = useContext(PersonaContext); + const { personas, getPersonas } = useContext(PersonaContext); const [isAddUserDropdownOpen, setIsAddUserDropdownOpen] = useState(false); const [submitError, setSubmitError] = useState(null); const [isLoading, setIsLoading] = useState(false); @@ -41,24 +41,6 @@ export function LoginComponent({ isLoggedIn, setIsLoggedIn, loginUser, name }: L getPersonas(); }, [isLoading]); - const handleSubmitNewPersona = () => { - const emailExists = personas.some(persona => persona.personaEmail === newPersona.email); - if (emailExists) { - setSubmitError('A persona with this email already exists.'); - return; - } - setIsLoading(true); - addPersona(newPersona) - .then(() => { - setIsAddUserDropdownOpen(false); - setIsLoading(false); - getPersonas(); - }) - .catch(error => { - setSubmitError('Failed to create new persona. Please try again.'); - setIsLoading(false); - }) - }; const showBackButton = () => { setIsAddUserDropdownOpen(false); @@ -85,14 +67,6 @@ export function LoginComponent({ isLoggedIn, setIsLoggedIn, loginUser, name }: L loginUser(name, email); }; - const handleDeleteAllPersonas = () => { - setIsLoading(true); - deleteAllPersonas() - .then(() => { - getPersonas(); - setIsLoading(false); - }) - } const handleSetActive = (personaname, personaemail) => { setActiveElement(personaname); @@ -159,8 +133,8 @@ export function LoginComponent({ isLoggedIn, setIsLoggedIn, loginUser, name }: L ) : (
- {personas.map((item: Persona) => ( -
+ {personas.map((item: Persona, index: number) => ( +
- @@ -250,7 +224,7 @@ export function LoginComponent({ isLoggedIn, setIsLoggedIn, loginUser, name }: L Add New User -
diff --git a/components/ui/marketcomponents/stores/MacroCenter.tsx b/components/ui/marketcomponents/stores/MacroCenter.tsx index 0e5a6df..0d5269d 100644 --- a/components/ui/marketcomponents/stores/MacroCenter.tsx +++ b/components/ui/marketcomponents/stores/MacroCenter.tsx @@ -48,9 +48,69 @@ export function MacroCenter({ const [inventory, setInventory] = useState([]); useEffect(() => { - fetch("/api/storeInventory?storename=macrocenter") - .then((response) => response.json()) - .then((data) => setInventory(data)); + const data = [ + { + "id": 11, + "vendor": "macrocenter", + "item": "High-Performance Graphics Card - 8GB", + "cost": "699.99" + }, + { + "id": 12, + "vendor": "macrocenter", + "item": "Gaming Motherboard - RGB Lighting", + "cost": "259.99" + }, + { + "id": 13, + "vendor": "macrocenter", + "item": "Solid State Drive (SSD) - 1TB", + "cost": "129.99" + }, + { + "id": 14, + "vendor": "macrocenter", + "item": "DDR4 RAM - 16GB Kit (2x8GB)", + "cost": "89.99" + }, + { + "id": 15, + "vendor": "macrocenter", + "item": "Modular Power Supply - 750W", + "cost": "119.99" + }, + { + "id": 16, + "vendor": "macrocenter", + "item": "CPU Cooler - Liquid Cooling System", + "cost": "139.99" + }, + { + "id": 17, + "vendor": "macrocenter", + "item": "Full-Tower PC Case - Tempered Glass", + "cost": "199.99" + }, + { + "id": 18, + "vendor": "macrocenter", + "item": "Wireless Gaming Keyboard and Mouse Combo", + "cost": "99.99" + }, + { + "id": 19, + "vendor": "macrocenter", + "item": "27-inch Gaming Monitor - 144Hz", + "cost": "329.99" + }, + { + "id": 20, + "vendor": "macrocenter", + "item": "Internal Sound Card - 7.1 Surround", + "cost": "79.99" + } + ]; + setInventory(data); }, []); return ( diff --git a/components/ui/marketcomponents/stores/TheBoominBox.tsx b/components/ui/marketcomponents/stores/TheBoominBox.tsx index b53921a..c276811 100644 --- a/components/ui/marketcomponents/stores/TheBoominBox.tsx +++ b/components/ui/marketcomponents/stores/TheBoominBox.tsx @@ -48,9 +48,70 @@ export function TheBoominBox({ const [inventory, setInventory] = useState([]); useEffect(() => { - fetch("/api/storeInventory?storename=boominbox") - .then((response) => response.json()) - .then((data) => setInventory(data)); + + const data = [ + { + "id": 21, + "vendor": "boominbox", + "item": "VR Headset - Advanced Model", + "cost": "499.99" + }, + { + "id": 22, + "vendor": "boominbox", + "item": "Bluetooth Noise-Canceling Headphones", + "cost": "299.99" + }, + { + "id": 23, + "vendor": "boominbox", + "item": "Wireless Earbuds - Waterproof Edition", + "cost": "159.99" + }, + { + "id": 24, + "vendor": "boominbox", + "item": "High-Fidelity Turntable", + "cost": "349.99" + }, + { + "id": 25, + "vendor": "boominbox", + "item": "Portable Bluetooth Speaker - Rugged Design", + "cost": "119.99" + }, + { + "id": 26, + "vendor": "boominbox", + "item": "Studio Monitor Speakers (Pair)", + "cost": "499.99" + }, + { + "id": 27, + "vendor": "boominbox", + "item": "Multi-Channel Home Theater System", + "cost": "999.99" + }, + { + "id": 28, + "vendor": "boominbox", + "item": "Digital Audio Interface - Pro Series", + "cost": "229.99" + }, + { + "id": 29, + "vendor": "boominbox", + "item": "Smart Home Sound System with Voice Control", + "cost": "399.99" + }, + { + "id": 30, + "vendor": "boominbox", + "item": "Professional DJ Mixer", + "cost": "699.99" + } + ] + setInventory(data); }, []); return ( diff --git a/components/ui/marketcomponents/stores/vrgalaxy.tsx b/components/ui/marketcomponents/stores/vrgalaxy.tsx index cf79b78..c1e5dbb 100644 --- a/components/ui/marketcomponents/stores/vrgalaxy.tsx +++ b/components/ui/marketcomponents/stores/vrgalaxy.tsx @@ -57,9 +57,69 @@ export function VRgalaxy({ useEffect(() => { - fetch("/api/storeInventory?storename=vrgalaxy") - .then((response) => response.json()) - .then((data) => setInventory(data)); + const data = [ + { + "id": 1, + "vendor": "vrgalaxy", + "item": "VR Headset - Advanced Model", + "cost": "499.99" + }, + { + "id": 2, + "vendor": "vrgalaxy", + "item": "Wireless VR Controllers (Pair)", + "cost": "119.99" + }, + { + "id": 3, + "vendor": "vrgalaxy", + "item": "VR Treadmill for Immersive Movement", + "cost": "899.99" + }, + { + "id": 4, + "vendor": "vrgalaxy", + "item": "Haptic Feedback Gloves", + "cost": "259.99" + }, + { + "id": 5, + "vendor": "vrgalaxy", + "item": "Virtual Reality Game - Space Adventure", + "cost": "59.99" + }, + { + "id": 6, + "vendor": "vrgalaxy", + "item": "VR Headset Cleaning Kit", + "cost": "29.99" + }, + { + "id": 7, + "vendor": "vrgalaxy", + "item": "360° VR Camera", + "cost": "349.99" + }, + { + "id": 8, + "vendor": "vrgalaxy", + "item": "Virtual Reality Development Software", + "cost": "199.99" + }, + { + "id": 9, + "vendor": "vrgalaxy", + "item": "Adjustable VR Headset Stand", + "cost": "39.99" + }, + { + "id": 10, + "vendor": "vrgalaxy", + "item": "Virtual Reality Experience Ticket - Underwater World", + "cost": "14.99" + } + ]; + setInventory(data); }, []); async function storeOpened() { diff --git a/drizzle.config.ts b/drizzle.config.ts index 25453c6..e56a9b1 100644 --- a/drizzle.config.ts +++ b/drizzle.config.ts @@ -1,10 +1,10 @@ -import type { Config } from "drizzle-kit"; +// import type { Config } from "drizzle-kit"; -export default { - schema: "./schema/schema.ts", - out: "./drizzle", - driver: "pg", - dbCredentials: { - connectionString: process.env.DB_URL || "", - } -} satisfies Config; \ No newline at end of file +// export default { +// schema: "./schema/schema.ts", +// out: "./drizzle", +// driver: "pg", +// dbCredentials: { +// connectionString: process.env.DB_URL || "", +// } +// } satisfies Config; \ No newline at end of file diff --git a/pages/api/bedrock.ts b/pages/api/bedrock.ts deleted file mode 100644 index de2c8fc..0000000 --- a/pages/api/bedrock.ts +++ /dev/null @@ -1,45 +0,0 @@ -import { - BedrockRuntimeClient, - InvokeModelCommand, -} from "@aws-sdk/client-bedrock-runtime"; -import { NextApiRequest, NextApiResponse } from 'next'; - - -export default async function bedrockCall(req: NextApiRequest, res: NextApiResponse) { - const client = new BedrockRuntimeClient({ region: "us-west-2" }); - const prompt = req.body; - - -// Debug jurassic another time - const input2 = { - modelId: "ai21.j2-ultra-v1", - contentType: "application/json", - accept: "application/json", - body: JSON.stringify({"prompt":`\n${prompt}`,"maxTokens":200,"temperature":0.7,"topP":1,"stopSequences":[],"countPenalty":{"scale":0},"presencePenalty":{"scale":0},"frequencyPenalty":{"scale":0}}) - } -// - - const input = { - modelId: "anthropic.claude-instant-v1", - contentType: "application/json", - accept: "application/json", - body: JSON.stringify({ - prompt: `\n\nHuman:${prompt}\n\nAssistant:`, - max_tokens_to_sample: 500, - temperature: 0.9, - top_p: 1, - }), - }; - const command = new InvokeModelCommand(input); - try { - const response = await client.send(command); - let decoder = new TextDecoder(); - let jsontext = JSON.parse(decoder.decode(response.body)); - // jurassic return structure - - res.status(200).json(jsontext); - } catch (error: any) { - - throw new Error(error.message); - } -} diff --git a/pages/api/checkingdata.ts b/pages/api/checkingdata.ts deleted file mode 100644 index e9e3329..0000000 --- a/pages/api/checkingdata.ts +++ /dev/null @@ -1,123 +0,0 @@ -// Next.js API route support: https://nextjs.org/docs/api-routes/introduction -import type { NextApiRequest, NextApiResponse } from 'next' -import { getServerClient } from '../../utils/ld-server'; -import { getCookie } from 'cookies-next'; -import { drizzle } from 'drizzle-orm/postgres-js' -import { eq } from 'drizzle-orm'; -import postgres from 'postgres' -import { transactions } from '@/schema/schema' -import { checkData } from '@/lib/checkingdata'; -import * as ld from '@launchdarkly/node-server-sdk' - - -type Data = { - id: number, - date: string | null, - merchant: string | null, - status: string | null, - amount: string | null, - accounttype: string | null, - user: string | null -}[] - -export default async function handler( - req: NextApiRequest, - res: NextApiResponse -) { - - function delay(low: number, high: number) { - const min = low * 1000; - const max = high * 1000; - const randomDelay = Math.floor(Math.random() * (max - min + 1)) + min; - //console.log("Delay is: "+randomDelay) - return new Promise(resolve => setTimeout(resolve, randomDelay)); - } - const ldClient = await getServerClient(process.env.LD_SDK_KEY || ""); - const clientContext: any = getCookie('ldcontext', { req, res }) - const connectionString = process.env.DB_URL - if (!connectionString) { - throw new Error('DATABASE_URL is not set') - } - const client = postgres(connectionString) - const db = drizzle(client); - - const config: ld.LDMigrationOptions = { - readOld: async (key?: string) => { - async function getMyData() { - const randomNumber = Math.floor(Math.random() * 100) + 1; - //console.log("random failure number: " + randomNumber) - if (randomNumber <= 20) { - //console.log("Error caught -") - throw new Error('Simulated failure'); - } - // console.log("Waiting delay") - await delay(1,3) - // console.log("Delay complete") - return checkData - } - - const result = await getMyData() - - if (result) { - - return ld.LDMigrationSuccess(result); - } else { - //@ts-ignore - return ld.LDMigrationError(new Error('Simulated failure')) - } - }, - - readNew: async (key?: string) => { - let checkingTransactions; - checkingTransactions = await db.select().from(transactions).where(eq(transactions.accounttype, 'checking')) - - if (checkingTransactions) { - //console.log(checkingTransactions) - return ld.LDMigrationSuccess(checkingTransactions) - } else { - // @ts-ignore - return ld.LDMigrationError(checkingTransactions.error as Error) - } - }, - - WriteOld: async (params?: { key: string, value: any }) => { - res.status(200) - - }, - - WriteNew: async (params?: { key: string, value: any }) => { - res.status(200) - }, - - execution: new ld.LDConcurrentExecution(), - latencyTracking: true, - errorTracking: true, - - } - //@ts-ignore - const migration = new ld.createMigration(ldClient, config) - - let jsonObject - - if (clientContext == undefined) { - jsonObject = { - key: '12234', - user: "Anonymous" - } - } else { - const json = decodeURIComponent(clientContext); - jsonObject = JSON.parse(json); - } - - if (req.method === 'GET') { - const checkingTransactions = await migration.read('financialDBMigration', jsonObject, 'off') - - if (checkingTransactions.success) { - //console.log("the success is - " + JSON.stringify(checkingTransactions)) - res.status(200).json(checkingTransactions.result) - } else { - //("the failure is - " + JSON.stringify(checkingTransactions)) - res.status(502).json({ error: 'Server encountered an error processing the request.' }) - } - } -} diff --git a/pages/api/creditdata.ts b/pages/api/creditdata.ts deleted file mode 100644 index e9a2b6e..0000000 --- a/pages/api/creditdata.ts +++ /dev/null @@ -1,87 +0,0 @@ -// Next.js API route support: https://nextjs.org/docs/api-routes/introduction -import type { NextApiRequest, NextApiResponse } from 'next' -import { drizzle } from 'drizzle-orm/postgres-js' -import { eq } from 'drizzle-orm'; -import postgres from 'postgres' -import { transactions } from '@/schema/schema' -import { creditData } from '@/lib/creditInserts'; -import { getServerClient } from '@/utils/ld-server'; -import { getCookie } from 'cookies-next'; -import * as ld from '@launchdarkly/node-server-sdk'; - -type Data = { - id: number, - date: string | null, - merchant: string | null, - status: string | null, - amount: number | null, - accounttype: string | null, - user: string | null -}[] - -export default async function handler( - req: NextApiRequest, - res: NextApiResponse -) { - - const connectionString = process.env.DB_URL - if (!connectionString) { - throw new Error('DATABASE_URL is not set') - } - const client = postgres(connectionString) - const db = drizzle(client); - const ldClient = await getServerClient(process.env.LD_SDK_KEY || ""); - const clientContext: any = getCookie('ldcontext', { req, res }) -const config: ld.LDMigrationOptions = { - readOld: async(key?: string) => { - //@ts-ignore - return [ - ld.LDMigrationSuccess, - creditData - ] - }, - - readNew: async(key?: string) => { - let creditTransactions; - creditTransactions = await db.select().from(transactions).where(eq(transactions.accounttype, 'checking')) - // @ts-ignore - return [ - ld.LDMigrationSuccess, - creditTransactions - ] - }, - - WriteOld: async(params?: {key: string, value: any}) => { - res.status(200) - - }, - - WriteNew: async(params?: {key: string, value: any}) => { - res.status(200) - }, - - execution: new ld.LDConcurrentExecution(), - latencyTracking: true, - errorTracking: true, - - } - - const migration = new ld.createMigration(ldClient, config) - let jsonObject - - if (clientContext == undefined) { - jsonObject = { - key: '12234', - user: "Anonymous" - } - } else { - const json = decodeURIComponent(clientContext); - jsonObject = JSON.parse(json); - } - - if (req.method === 'GET') { - const creditTransactions = await migration.read('financialDBMigration', jsonObject, 'off') - res.status(200).json(creditTransactions[1]) - -} -} diff --git a/pages/api/personas.ts b/pages/api/personas.ts deleted file mode 100644 index 97d0511..0000000 --- a/pages/api/personas.ts +++ /dev/null @@ -1,202 +0,0 @@ -import type { NextApiRequest, NextApiResponse } from "next"; -import { drizzle } from "drizzle-orm/postgres-js"; -import postgres from "postgres"; -import { sql } from "drizzle-orm"; -import { pgTable, serial, text } from "drizzle-orm/pg-core"; - -import os from "os"; - -// @ts-ignore -type Data = { - id: number; - name: string | null; - email: string | null; - image: number | null; -}[]; - -type PostData = { - name: string; - type: string; - image: string; - email: string; -}; - -function getSubdomain(req: NextApiRequest): string | null { - const host = req.headers.host; - if (!host) return null; - if (host.startsWith("localhost:") || host.startsWith("127.0.0.1:")) { - return os.hostname().toLowerCase().replace(/\./g, "_"); - } - const parts = host.split("."); - return parts.length > 2 ? parts[0] : null; -} - -async function createTableForSubdomain( - db: ReturnType, - subdomain: string -) { - const tableName = `personas_${subdomain}`; - - const checkTableExistsSQL = sql` - SELECT EXISTS ( - SELECT FROM information_schema.tables - WHERE table_schema = 'public' - AND table_name = ${tableName} - ); - `; - const tableExists = await db.execute(checkTableExistsSQL); - if (!tableExists[0].exists) { - const createTableSQL = sql` - CREATE TABLE ${sql.identifier(tableName)} ( - id SERIAL PRIMARY KEY, - personaname TEXT, - personatype TEXT, - personaimage TEXT, - personaemail TEXT - ); -`; - await db.execute(createTableSQL); - } - - const personaschema = pgTable(tableName, { - id: serial("id").primaryKey(), - personaname: text("personaname"), - personatype: text("personatype"), - personaimage: text("personaimage"), - personaemail: text("personaemail"), - }); - - return personaschema; -} - -export default async function handler( - req: NextApiRequest, - res: NextApiResponse -) { - const connectionString = process.env.DB_URL; - if (!connectionString) { - throw new Error("DATABASE_URL is not set"); - } - const client = postgres(connectionString); - const db = drizzle(client); - - const subdomain = getSubdomain(req); - if (!subdomain) { - res.status(400).json({ error: "Subdomain is required" }); - return; - } - const personaschema = await createTableForSubdomain(db, subdomain); - - const tableName = `personas_${subdomain}`; - - switch (req.method) { - case "GET": - await handleGet(req, res, db, personaschema); - break; - case "POST": - await handlePost(req, res, db, personaschema); - break; - case "DELETE": - await handleDelete(res, db, personaschema); - break; - default: - res.setHeader("Allow", ["GET", "POST"]); - res.status(405).json({ error: `Method ${req.method} Not Allowed` }); - } -} - -async function handleGet( - req: NextApiRequest, - res: NextApiResponse, - db: ReturnType, - personaschema: ReturnType -) { - const { personaToQuery } = req.query; - if (typeof personaToQuery !== "string") { - res.status(400).json({ error: "Invalid persona" }); - return; - } - - let persona; - - if (personaToQuery === "all") { - persona = await db.select().from(personaschema).execute(); - if (persona.length === 0) { - const usersToAdd = [ - { - personaname: "Cody", - personatype: "Standard User", - personaimage: "standard.jpg", - personaemail: "cody@launchmail.io", - }, - { - personaname: "Alysha", - personatype: "Beta User", - personaimage: "beta.png", - personaemail: "alysha@launchmail.io", - }, - { - personaname: "Jenn", - personatype: "Developer", - personaimage: "woman.png", - personaemail: "jenn@launchmail.io", - }, - ]; - - try { - for (const user of usersToAdd) { - await db.insert(personaschema).values(user).execute(); - } - } catch (error) { - console.error(error); - res.status(500).json({ error: "Failed to add new users" }); - return; - } - } - } - // @ts-ignore - res.status(200).json(persona); -} - -async function handlePost( - req: NextApiRequest, - res: NextApiResponse, - db: ReturnType, - personaschema: ReturnType -) { - const { name, type, image, email } = req.body as PostData; - if (!name || !type || !email || image === undefined) { - res.status(400).json({ error: "Missing fields" }); - return; - } - - try { - const newPersona = await db - .insert(personaschema) - .values({ - personaname: name, - personatype: type, - personaimage: image, - personaemail: email, - }) - .execute(); - res.status(201).json(newPersona); - } catch (error) { - - res.status(500).json({ error: "Internal Server Error" }); - } -} - -async function handleDelete( - res: NextApiResponse, - db: ReturnType, - personaschema: ReturnType -) { - try { - await db.delete(personaschema).execute(); - res.status(201); - } catch (error) { - console.error(error); - res.status(500).json({ error: "Failed to delete personas" }); - } -} diff --git a/pages/api/storeInventory.ts b/pages/api/storeInventory.ts deleted file mode 100644 index d0bc98a..0000000 --- a/pages/api/storeInventory.ts +++ /dev/null @@ -1,47 +0,0 @@ -import type { NextApiRequest, NextApiResponse } from "next"; -import { drizzle } from "drizzle-orm/postgres-js"; -import { eq } from "drizzle-orm"; -import postgres from "postgres"; -import { galaxymarketplace } from "@/schema/schema"; -// @ts-ignore - -type Data = { - id: number; - item: string | null; - vendor: string | null; - cost: number | null; -}[]; - -export default async function handler( - req: NextApiRequest, - res: NextApiResponse -) { - - const { storename } = req.query; - if (typeof storename !== "string") { - res.status(400).json({ error: "Invalid storename" }); - return; - } - - const connectionString = process.env.DB_URL; - if (!connectionString) { - throw new Error("DATABASE_URL is not set"); - } - const client = postgres(connectionString); - const db = drizzle(client); - // @ts-ignore - - let storeInventory; - if (storename === "all") { - storeInventory = await db.select().from(galaxymarketplace); - } else { - storeInventory = await db - .select() - .from(galaxymarketplace) - .where(eq(galaxymarketplace.vendor, storename)); - } - // @ts-ignore - - - res.status(200).json(storeInventory); -} diff --git a/pages/marketplace.tsx b/pages/marketplace.tsx index 89729e4..b3d6605 100644 --- a/pages/marketplace.tsx +++ b/pages/marketplace.tsx @@ -53,9 +53,189 @@ export default function Marketplace() { useEffect(() => { - fetch("/api/storeInventory?storename=all") - .then((response) => response.json()) - .then((data) => setProducts(data)); + const data = [ + { + "id": 1, + "vendor": "vrgalaxy", + "item": "VR Headset - Advanced Model", + "cost": "499.99" + }, + { + "id": 2, + "vendor": "vrgalaxy", + "item": "Wireless VR Controllers (Pair)", + "cost": "119.99" + }, + { + "id": 3, + "vendor": "vrgalaxy", + "item": "VR Treadmill for Immersive Movement", + "cost": "899.99" + }, + { + "id": 4, + "vendor": "vrgalaxy", + "item": "Haptic Feedback Gloves", + "cost": "259.99" + }, + { + "id": 5, + "vendor": "vrgalaxy", + "item": "Virtual Reality Game - Space Adventure", + "cost": "59.99" + }, + { + "id": 6, + "vendor": "vrgalaxy", + "item": "VR Headset Cleaning Kit", + "cost": "29.99" + }, + { + "id": 7, + "vendor": "vrgalaxy", + "item": "360° VR Camera", + "cost": "349.99" + }, + { + "id": 8, + "vendor": "vrgalaxy", + "item": "Virtual Reality Development Software", + "cost": "199.99" + }, + { + "id": 9, + "vendor": "vrgalaxy", + "item": "Adjustable VR Headset Stand", + "cost": "39.99" + }, + { + "id": 10, + "vendor": "vrgalaxy", + "item": "Virtual Reality Experience Ticket - Underwater World", + "cost": "14.99" + }, + { + "id": 11, + "vendor": "macrocenter", + "item": "High-Performance Graphics Card - 8GB", + "cost": "699.99" + }, + { + "id": 12, + "vendor": "macrocenter", + "item": "Gaming Motherboard - RGB Lighting", + "cost": "259.99" + }, + { + "id": 13, + "vendor": "macrocenter", + "item": "Solid State Drive (SSD) - 1TB", + "cost": "129.99" + }, + { + "id": 14, + "vendor": "macrocenter", + "item": "DDR4 RAM - 16GB Kit (2x8GB)", + "cost": "89.99" + }, + { + "id": 15, + "vendor": "macrocenter", + "item": "Modular Power Supply - 750W", + "cost": "119.99" + }, + { + "id": 16, + "vendor": "macrocenter", + "item": "CPU Cooler - Liquid Cooling System", + "cost": "139.99" + }, + { + "id": 17, + "vendor": "macrocenter", + "item": "Full-Tower PC Case - Tempered Glass", + "cost": "199.99" + }, + { + "id": 18, + "vendor": "macrocenter", + "item": "Wireless Gaming Keyboard and Mouse Combo", + "cost": "99.99" + }, + { + "id": 19, + "vendor": "macrocenter", + "item": "27-inch Gaming Monitor - 144Hz", + "cost": "329.99" + }, + { + "id": 20, + "vendor": "macrocenter", + "item": "Internal Sound Card - 7.1 Surround", + "cost": "79.99" + }, + { + "id": 21, + "vendor": "boominbox", + "item": "VR Headset - Advanced Model", + "cost": "499.99" + }, + { + "id": 22, + "vendor": "boominbox", + "item": "Bluetooth Noise-Canceling Headphones", + "cost": "299.99" + }, + { + "id": 23, + "vendor": "boominbox", + "item": "Wireless Earbuds - Waterproof Edition", + "cost": "159.99" + }, + { + "id": 24, + "vendor": "boominbox", + "item": "High-Fidelity Turntable", + "cost": "349.99" + }, + { + "id": 25, + "vendor": "boominbox", + "item": "Portable Bluetooth Speaker - Rugged Design", + "cost": "119.99" + }, + { + "id": 26, + "vendor": "boominbox", + "item": "Studio Monitor Speakers (Pair)", + "cost": "499.99" + }, + { + "id": 27, + "vendor": "boominbox", + "item": "Multi-Channel Home Theater System", + "cost": "999.99" + }, + { + "id": 28, + "vendor": "boominbox", + "item": "Digital Audio Interface - Pro Series", + "cost": "229.99" + }, + { + "id": 29, + "vendor": "boominbox", + "item": "Smart Home Sound System with Voice Control", + "cost": "399.99" + }, + { + "id": 30, + "vendor": "boominbox", + "item": "Professional DJ Mixer", + "cost": "699.99" + } + ]; + setProducts(data); }, []); useEffect(() => {