-
- Buyurtma #{order.order_number}
-
ID: {order.id}
@@ -99,12 +74,6 @@ const OrderDetail = ({ detail, setDetail, order }: Props) => {
{formatPrice(order.total_price)}
-
{order.lat && order.long && (
@@ -172,16 +116,6 @@ const OrderDetail = ({ detail, setDetail, order }: Props) => {
)}
-
-
-
- To'lov turi
-
-
- {order.payment_type === "CASH" ? "Naxt" : "Karta orqali"}
-
-
-
{order.comment && (
diff --git a/src/features/order/ui/OrderTable.tsx b/src/features/order/ui/OrderTable.tsx
index 54fe1fc..219b423 100644
--- a/src/features/order/ui/OrderTable.tsx
+++ b/src/features/order/ui/OrderTable.tsx
@@ -2,7 +2,6 @@
import { order_api } from "@/features/order/lib/api";
import type { Order } from "@/features/order/lib/type";
-import formatPhone from "@/shared/lib/formatPhone";
import formatPrice from "@/shared/lib/formatPrice";
import { Button } from "@/shared/ui/button";
import {
@@ -35,12 +34,6 @@ interface Props {
setOrderDetail: Dispatch>;
}
-const deliveryTypeLabel: Record = {
- YANDEX_GO: "Yandex Go",
- DELIVERY_COURIES: "Kuryer orqali yetkazish",
- PICKUP: "O‘zi olib ketish",
-};
-
type OrderStatus =
| "NEW"
// "PROCESSING" |
@@ -113,11 +106,7 @@ const OrderTable = ({
#
- Order №
Foydalanuvchi
- Kontakt
- Toʻlov turi
- Yetkazib berish
Umumiy narx
Izoh
Holat
@@ -129,18 +118,7 @@ const OrderTable = ({
{orders.map((order, index) => (
{index + 1}
- {order.order_number}
-
- {order.user.first_name} {order.user.last_name} (
- {order.user.username})
-
- {formatPhone(order.contact_number)}
-
- {order.payment_type === "CASH" ? "Naxt" : "Karta orqali"}
-
-
- {deliveryTypeLabel[order.delivery_type] ?? order.delivery_type}
-
+ {order.user.username}
{formatPrice(order.total_price, true)}
{order.comment || "-"}
diff --git a/src/features/plans/lib/form.ts b/src/features/plans/lib/form.ts
index 85d50bd..713c33f 100644
--- a/src/features/plans/lib/form.ts
+++ b/src/features/plans/lib/form.ts
@@ -5,8 +5,8 @@ export const createPlanFormData = z.object({
name_ru: z.string().min(1, "Majburiy maydon"),
description_uz: z.string().min(1, "Majburiy maydon"),
description_ru: z.string().min(1, "Majburiy maydon"),
- category_id: z.string().uuid("Kategoriya noto‘g‘ri"),
- unity_id: z.string().uuid("Birlik noto‘g‘ri"),
+ category_id: z.string(),
+ unity_id: z.string(),
price: z.number().positive("Narx noto‘g‘ri"),
quantity_left: z.number().min(0),
min_quantity: z.number().min(0),
diff --git a/src/features/plans/ui/ExcelUpload.tsx b/src/features/plans/ui/ExcelUpload.tsx
new file mode 100644
index 0000000..34c6cf5
--- /dev/null
+++ b/src/features/plans/ui/ExcelUpload.tsx
@@ -0,0 +1,51 @@
+"use client";
+
+import { Button } from "@/shared/ui/button";
+import { useRef } from "react";
+
+export default function ExcelUpload() {
+ const fileInputRef = useRef(null);
+
+ const handleButtonClick = () => {
+ fileInputRef.current?.click();
+ };
+
+ const handleFileChange = (e: React.ChangeEvent) => {
+ const file = e.target.files?.[0];
+ if (!file) return;
+
+ // Excel format tekshiruvi
+ const allowedTypes = [
+ "application/vnd.ms-excel",
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
+ ];
+
+ if (!allowedTypes.includes(file.type)) {
+ alert("Iltimos, faqat Excel (.xls, .xlsx) fayl yuklang");
+ return;
+ }
+
+ // 👉 shu yerda backendga yuborasiz
+ // uploadExcel(file)
+ };
+
+ return (
+ <>
+
+
+
+ >
+ );
+}
diff --git a/src/features/plans/ui/FilterPlans.tsx b/src/features/plans/ui/FilterPlans.tsx
index 458c7d3..381516c 100644
--- a/src/features/plans/ui/FilterPlans.tsx
+++ b/src/features/plans/ui/FilterPlans.tsx
@@ -1,5 +1,6 @@
import type { Product } from "@/features/plans/lib/data";
import AddedPlan from "@/features/plans/ui/AddedPlan";
+import ExcelUpload from "@/features/plans/ui/ExcelUpload";
import { Button } from "@/shared/ui/button";
import {
Dialog,
@@ -9,7 +10,7 @@ import {
DialogTrigger,
} from "@/shared/ui/dialog";
import { Input } from "@/shared/ui/input";
-import { Plus } from "lucide-react";
+import { AlertCircle, Plus } from "lucide-react";
import type { Dispatch, SetStateAction } from "react";
interface Props {
@@ -38,6 +39,30 @@ const FilterPlans = ({
value={searchUser}
onChange={(e) => setSearchUser(e.target.value)}
/>
+
+