FIX
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
"use client"
|
||||
|
||||
import React, { useState, useEffect } from "react";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { useRouter, useSearchParams } from "next/navigation";
|
||||
import { Card, CardContent, CardHeader, CardTitle, CardDescription } from "@/components/ui/card";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Input } from "@/components/ui/input";
|
||||
@@ -14,12 +14,21 @@ import { getCookie } from "@/lib/client-utils";
|
||||
|
||||
export default function NewChatForm() {
|
||||
const router = useRouter();
|
||||
const searchParams = useSearchParams();
|
||||
const [buyerId, setBuyerId] = useState("");
|
||||
const [initialMessage, setInitialMessage] = useState("");
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [vendorStores, setVendorStores] = useState<{ _id: string, name: string }[]>([]);
|
||||
const [selectedStore, setSelectedStore] = useState<string>("");
|
||||
|
||||
// Parse URL parameters for buyerId
|
||||
useEffect(() => {
|
||||
const buyerIdParam = searchParams.get('buyerId');
|
||||
if (buyerIdParam) {
|
||||
setBuyerId(buyerIdParam);
|
||||
}
|
||||
}, [searchParams]);
|
||||
|
||||
// Fetch vendor stores
|
||||
useEffect(() => {
|
||||
const fetchVendorStores = async () => {
|
||||
|
||||
@@ -9,8 +9,6 @@ import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/com
|
||||
import { ShoppingCart } from "lucide-react"
|
||||
import { ArrowUpCircle, CreditCard, DollarSign, Users } from "lucide-react"
|
||||
import { Skeleton } from "@/components/ui/skeleton"
|
||||
import { OrderStats as DashboardOrderStats } from "@/components/dashboard/order-stats"
|
||||
import OrderStatsData from "@/types/orderStats"
|
||||
|
||||
interface ContentProps {
|
||||
username: string
|
||||
|
||||
Reference in New Issue
Block a user