diff --git a/components/KeepOnline.ts b/components/KeepOnline.ts
index fe53598..53909cd 100644
--- a/components/KeepOnline.ts
+++ b/components/KeepOnline.ts
@@ -1,4 +1,4 @@
-"use client";
+"use client";
import { useKeepOnline } from "@/hooks/useKeepOnline";
@@ -14,4 +14,4 @@ const KeepOnline = () => {
return null;
}
-export default KeepOnline;
\ No newline at end of file
+export default KeepOnline;
diff --git a/components/admin/AdminAnalytics.tsx b/components/admin/AdminAnalytics.tsx
index 3aa294b..8412baa 100644
--- a/components/admin/AdminAnalytics.tsx
+++ b/components/admin/AdminAnalytics.tsx
@@ -1,4 +1,4 @@
-"use client";
+"use client";
import React, { useState, useEffect } from "react";
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card";
@@ -739,4 +739,4 @@ export default function AdminAnalytics() {
);
-}
\ No newline at end of file
+}
diff --git a/components/admin/BanUserCard.tsx b/components/admin/BanUserCard.tsx
index 9ddcf0e..4143f65 100644
--- a/components/admin/BanUserCard.tsx
+++ b/components/admin/BanUserCard.tsx
@@ -1,4 +1,4 @@
-"use client";
+"use client";
import { useState } from "react";
import { fetchClient } from "@/lib/api-client";
diff --git a/components/admin/InvitationsListCard.tsx b/components/admin/InvitationsListCard.tsx
index 18172d3..0c5e41d 100644
--- a/components/admin/InvitationsListCard.tsx
+++ b/components/admin/InvitationsListCard.tsx
@@ -1,4 +1,4 @@
-"use client";
+"use client";
import { useEffect, useState } from "react";
import { fetchClient } from "@/lib/api-client";
@@ -62,7 +62,7 @@ export default function InvitationsListCard() {
Code: {inv.code}
- Created: {new Date(inv.createdAt).toLocaleString()} · Expires: {new Date(inv.expiresAt).toLocaleString()}
+ Created: {new Date(inv.createdAt).toLocaleString()} • Expires: {new Date(inv.expiresAt).toLocaleString()}
diff --git a/components/admin/InviteVendorCard.tsx b/components/admin/InviteVendorCard.tsx
index b7295b6..a13a80b 100644
--- a/components/admin/InviteVendorCard.tsx
+++ b/components/admin/InviteVendorCard.tsx
@@ -1,4 +1,4 @@
-"use client";
+"use client";
import { useState } from "react";
import { fetchClient } from "@/lib/api-client";
diff --git a/components/admin/OrdersTable.tsx b/components/admin/OrdersTable.tsx
index 2363d09..52b0415 100644
--- a/components/admin/OrdersTable.tsx
+++ b/components/admin/OrdersTable.tsx
@@ -1,4 +1,4 @@
-"use client";
+"use client";
import { useState } from "react";
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card";
diff --git a/components/admin/RecentOrdersCard.tsx b/components/admin/RecentOrdersCard.tsx
index 6f4c5f6..a4eb471 100644
--- a/components/admin/RecentOrdersCard.tsx
+++ b/components/admin/RecentOrdersCard.tsx
@@ -1,4 +1,4 @@
-"use client";
+"use client";
import { useEffect, useState } from "react";
import { fetchClient } from "@/lib/api-client";
@@ -81,7 +81,7 @@ export default function RecentOrdersCard() {
- User: {o.userId} · Total: £{Number(o.total).toFixed(2)}
+ User: {o.userId} • Total: £{Number(o.total).toFixed(2)}
{o.items && o.items.length > 0 && (
diff --git a/components/admin/SystemStatusCard.tsx b/components/admin/SystemStatusCard.tsx
index f035127..c462421 100644
--- a/components/admin/SystemStatusCard.tsx
+++ b/components/admin/SystemStatusCard.tsx
@@ -1,4 +1,4 @@
-"use client";
+"use client";
import { useEffect, useState } from "react";
import { fetchClient } from "@/lib/api-client";
import { Button } from "@/components/ui/button";
diff --git a/components/admin/VendorsCard.tsx b/components/admin/VendorsCard.tsx
index 6160dc0..fe11d5d 100644
--- a/components/admin/VendorsCard.tsx
+++ b/components/admin/VendorsCard.tsx
@@ -1,4 +1,4 @@
-"use client";
+"use client";
import { useEffect, useState } from "react";
import { fetchClient } from "@/lib/api-client";
@@ -63,7 +63,7 @@ export default function VendorsCard() {
{vendor.username}
Created: {new Date(vendor.createdAt).toLocaleDateString()}
- {vendor.lastLogin && ` · Last login: ${new Date(vendor.lastLogin).toLocaleDateString()}`}
+ {vendor.lastLogin && ` • Last login: ${new Date(vendor.lastLogin).toLocaleDateString()}`}
diff --git a/components/animated-counter.tsx b/components/animated-counter.tsx
index c3ce52a..9abf57d 100644
--- a/components/animated-counter.tsx
+++ b/components/animated-counter.tsx
@@ -1,4 +1,4 @@
-"use client";
+"use client";
import { useState, useEffect, useRef } from "react";
@@ -68,4 +68,4 @@ export function AnimatedCounter({
: `${prefix}${displayValue.toLocaleString()}${suffix}`;
return {formattedValue};
-}
\ No newline at end of file
+}
diff --git a/components/animated-stats-section.tsx b/components/animated-stats-section.tsx
index c7eafdd..30382ca 100644
--- a/components/animated-stats-section.tsx
+++ b/components/animated-stats-section.tsx
@@ -1,4 +1,4 @@
-"use client";
+"use client";
import { Package, Users, CreditCard } from "lucide-react";
import { AnimatedCounter } from "./animated-counter";
@@ -80,4 +80,4 @@ export function AnimatedStatsSection({ stats }: AnimatedStatsProps) {
);
-}
\ No newline at end of file
+}
diff --git a/components/audio-preloader.tsx b/components/audio-preloader.tsx
index 51adb02..068c8eb 100644
--- a/components/audio-preloader.tsx
+++ b/components/audio-preloader.tsx
@@ -1,4 +1,4 @@
-"use client"
+"use client"
import { useEffect } from "react"
diff --git a/components/christmas-decorations.tsx b/components/christmas-decorations.tsx
index bcdcd00..cafadb7 100644
--- a/components/christmas-decorations.tsx
+++ b/components/christmas-decorations.tsx
@@ -1,4 +1,4 @@
-"use client"
+"use client"
import { useEffect, useState } from "react"
import { isDecember } from "@/lib/utils/christmas"
@@ -39,30 +39,30 @@ export function ChristmasDecorations() {
animationDuration: `${flake.duration}s`,
}}
>
- ❄
+ ÔØä
))}
{/* Twinkling stars in corners */}
- ✨
+ Ô£¿
- ✨
+ Ô£¿
- ✨
+ Ô£¿
- ✨
+ Ô£¿
{/* Christmas tree emoji decorations */}
- 🎄
+ ƒÄä
- 🎄
+ ƒÄä
)
diff --git a/components/dashboard/BuyerOrderInfo.tsx b/components/dashboard/BuyerOrderInfo.tsx
index 064bbf9..aed607b 100644
--- a/components/dashboard/BuyerOrderInfo.tsx
+++ b/components/dashboard/BuyerOrderInfo.tsx
@@ -1,4 +1,4 @@
-"use client";
+"use client";
import React, { useState, useEffect, useCallback, useRef } from "react";
import { Package, ShoppingBag, Info, ExternalLink, Loader2, AlertTriangle } from "lucide-react";
@@ -237,7 +237,7 @@ export default function BuyerOrderInfo({ buyerId, chatId }: BuyerOrderInfoProps)
Customer Orders
- {orders.length} {orders.length === 1 ? 'order' : 'orders'} • Total: {formatPrice(
+ {orders.length} {orders.length === 1 ? 'order' : 'orders'} ÔÇó Total: {formatPrice(
orders.reduce((sum, order) => sum + order.totalPrice, 0)
)}
@@ -279,11 +279,11 @@ export default function BuyerOrderInfo({ buyerId, chatId }: BuyerOrderInfoProps)
{order.products.length} {order.products.length === 1 ? 'product' : 'products'}
- ·
+ •
{formatPrice(order.totalPrice)}
{isOrderUnderpaid(order) && (
<>
- ·
+ •
Underpaid
>
)}
@@ -299,4 +299,4 @@ export default function BuyerOrderInfo({ buyerId, chatId }: BuyerOrderInfoProps)
);
-}
\ No newline at end of file
+}
diff --git a/components/dashboard/ChatDetail.tsx b/components/dashboard/ChatDetail.tsx
index 017d176..f4f5ccc 100644
--- a/components/dashboard/ChatDetail.tsx
+++ b/components/dashboard/ChatDetail.tsx
@@ -1,4 +1,4 @@
-"use client"
+"use client"
import React, { useState, useEffect, useRef } from "react";
import { useRouter } from "next/navigation";
@@ -832,4 +832,4 @@ export default function ChatDetail({ chatId }: { chatId: string }) {
/>
);
-}
\ No newline at end of file
+}
diff --git a/components/dashboard/ChatTable.tsx b/components/dashboard/ChatTable.tsx
index ff63394..2b1d6c1 100644
--- a/components/dashboard/ChatTable.tsx
+++ b/components/dashboard/ChatTable.tsx
@@ -1,4 +1,4 @@
-"use client"
+"use client"
import React, { useState, useEffect, useRef, useCallback } from 'react';
import { useRouter } from 'next/navigation';
@@ -420,4 +420,4 @@ export default function ChatTable() {
)}
);
-}
\ No newline at end of file
+}
diff --git a/components/dashboard/NewChatForm.tsx b/components/dashboard/NewChatForm.tsx
index c8a7414..404c5dd 100644
--- a/components/dashboard/NewChatForm.tsx
+++ b/components/dashboard/NewChatForm.tsx
@@ -1,4 +1,4 @@
-"use client"
+"use client"
import React, { useState, useEffect } from "react";
import { useRouter, useSearchParams } from "next/navigation";
@@ -350,4 +350,4 @@ export default function NewChatForm() {
);
-}
\ No newline at end of file
+}
diff --git a/components/dashboard/content.tsx b/components/dashboard/content.tsx
index 7c8ba0e..ab6b9e1 100644
--- a/components/dashboard/content.tsx
+++ b/components/dashboard/content.tsx
@@ -1,4 +1,4 @@
-"use client"
+"use client"
import { useState, useEffect } from "react"
import OrderStats from "./order-stats"
@@ -75,7 +75,7 @@ export default function Content({ username, orderStats }: ContentProps) {
{greeting}, {username}!
- "{randomQuote.text}" — {randomQuote.author}
+ "{randomQuote.text}" ÔÇö {randomQuote.author}
diff --git a/components/dashboard/dashboard.tsx b/components/dashboard/dashboard.tsx
index 5bec345..d6cc568 100644
--- a/components/dashboard/dashboard.tsx
+++ b/components/dashboard/dashboard.tsx
@@ -1,4 +1,4 @@
-import type React from "react"
+import type React from "react"
import Layout from "../layout/layout"
export default function Dashboard({ children }: { children: React.ReactNode }) {
diff --git a/components/dashboard/order-stats.tsx b/components/dashboard/order-stats.tsx
index a9051d0..aa18d00 100644
--- a/components/dashboard/order-stats.tsx
+++ b/components/dashboard/order-stats.tsx
@@ -1,4 +1,4 @@
-import type { LucideIcon } from "lucide-react"
+import type { LucideIcon } from "lucide-react"
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"
interface OrderStatsProps {
diff --git a/components/dashboard/page-loading.tsx b/components/dashboard/page-loading.tsx
index 5574836..ca3d5c1 100644
--- a/components/dashboard/page-loading.tsx
+++ b/components/dashboard/page-loading.tsx
@@ -1,4 +1,4 @@
-"use client"
+"use client"
import { Skeleton } from "@/components/ui/skeleton";
import { Card } from "@/components/ui/card";
@@ -113,4 +113,4 @@ export default function PageLoading({
);
-}
\ No newline at end of file
+}
diff --git a/components/dashboard/promotions/EditPromotionForm.tsx b/components/dashboard/promotions/EditPromotionForm.tsx
index 473b117..acfc1a3 100644
--- a/components/dashboard/promotions/EditPromotionForm.tsx
+++ b/components/dashboard/promotions/EditPromotionForm.tsx
@@ -1,4 +1,4 @@
-'use client';
+'use client';
import { useState, useEffect } from 'react';
import { z } from 'zod';
@@ -464,4 +464,4 @@ export default function EditPromotionForm({ promotion, onSuccess, onCancel }: Ed
);
-}
\ No newline at end of file
+}
diff --git a/components/dashboard/promotions/NewPromotionForm.tsx b/components/dashboard/promotions/NewPromotionForm.tsx
index 715799c..43b7e11 100644
--- a/components/dashboard/promotions/NewPromotionForm.tsx
+++ b/components/dashboard/promotions/NewPromotionForm.tsx
@@ -1,4 +1,4 @@
-'use client';
+'use client';
import { useState, useEffect } from 'react';
import { z } from 'zod';
@@ -459,4 +459,4 @@ export default function NewPromotionForm({ onSuccess, onCancel }: NewPromotionFo
);
-}
\ No newline at end of file
+}
diff --git a/components/dashboard/promotions/ProductSelector.tsx b/components/dashboard/promotions/ProductSelector.tsx
index 27bc2b2..384f728 100644
--- a/components/dashboard/promotions/ProductSelector.tsx
+++ b/components/dashboard/promotions/ProductSelector.tsx
@@ -1,4 +1,4 @@
-'use client';
+'use client';
import { useState, useEffect, useRef } from 'react';
import { Check, ChevronDown, X, Search } from 'lucide-react';
@@ -248,4 +248,4 @@ export default function ProductSelector({
)}
);
-}
\ No newline at end of file
+}
diff --git a/components/dashboard/promotions/PromotionDetailsModal.tsx b/components/dashboard/promotions/PromotionDetailsModal.tsx
index 8ed342c..6d507f9 100644
--- a/components/dashboard/promotions/PromotionDetailsModal.tsx
+++ b/components/dashboard/promotions/PromotionDetailsModal.tsx
@@ -1,4 +1,4 @@
-'use client';
+'use client';
import { useState, useEffect } from 'react';
import {
@@ -222,7 +222,7 @@ export default function PromotionDetailsModal({
Current Usage
- {promotion.usageCount} / {promotion.maxUsage || '∞'}
+ {promotion.usageCount} / {promotion.maxUsage || 'Ôê×'}
@@ -382,4 +382,4 @@ export default function PromotionDetailsModal({
);
-}
\ No newline at end of file
+}
diff --git a/components/dashboard/promotions/PromotionsList.tsx b/components/dashboard/promotions/PromotionsList.tsx
index 0e4daa2..a53d323 100644
--- a/components/dashboard/promotions/PromotionsList.tsx
+++ b/components/dashboard/promotions/PromotionsList.tsx
@@ -1,4 +1,4 @@
-'use client';
+'use client';
import { useState, useEffect } from 'react';
import { Plus, Tag, RefreshCw, Trash, Edit, Check, X, Eye } from 'lucide-react';
@@ -184,7 +184,7 @@ export default function PromotionsList() {
: 'None'}
- {promotion.usageCount} / {promotion.maxUsage || '∞'}
+ {promotion.usageCount} / {promotion.maxUsage || 'Ôê×'}
{formatDate(promotion.endDate)}
@@ -306,4 +306,4 @@ export default function PromotionsList() {
/>
>
);
-}
\ No newline at end of file
+}
diff --git a/components/dashboard/promotions/PromotionsPageSkeleton.tsx b/components/dashboard/promotions/PromotionsPageSkeleton.tsx
index af97572..4d626e2 100644
--- a/components/dashboard/promotions/PromotionsPageSkeleton.tsx
+++ b/components/dashboard/promotions/PromotionsPageSkeleton.tsx
@@ -1,4 +1,4 @@
-import {
+import {
Table,
TableBody,
TableCell,
@@ -59,4 +59,4 @@ export default function PromotionsPageSkeleton() {
);
-}
\ No newline at end of file
+}
diff --git a/components/home-navbar.tsx b/components/home-navbar.tsx
index 5eeb0d9..b850a08 100644
--- a/components/home-navbar.tsx
+++ b/components/home-navbar.tsx
@@ -1,4 +1,4 @@
-"use client";
+"use client";
import Link from "next/link";
import { Button } from "@/components/ui/button";
@@ -89,4 +89,4 @@ export function HomeNavbar() {
)}
);
-}
\ No newline at end of file
+}
diff --git a/components/layout/KeepOnlineWrapper.tsx b/components/layout/KeepOnlineWrapper.tsx
index 0fba45d..ee77023 100644
--- a/components/layout/KeepOnlineWrapper.tsx
+++ b/components/layout/KeepOnlineWrapper.tsx
@@ -1,4 +1,4 @@
-"use client";
+"use client";
import { usePathname } from "next/navigation";
import KeepOnline from "@/components/KeepOnline";
@@ -14,4 +14,4 @@ const KeepOnlineWrapper = () => {
return ;
};
-export default KeepOnlineWrapper;
\ No newline at end of file
+export default KeepOnlineWrapper;
diff --git a/components/layout/layout.tsx b/components/layout/layout.tsx
index 7daf193..5071a52 100644
--- a/components/layout/layout.tsx
+++ b/components/layout/layout.tsx
@@ -1,4 +1,4 @@
-"use client"
+"use client"
import { useState, useEffect } from "react"
import { useTheme } from "next-themes"
diff --git a/components/layout/nav-item.tsx b/components/layout/nav-item.tsx
index 553be3e..b3bd125 100644
--- a/components/layout/nav-item.tsx
+++ b/components/layout/nav-item.tsx
@@ -1,4 +1,4 @@
-"use client"
+"use client"
import Link from "next/link"
import { usePathname } from "next/navigation"
@@ -65,4 +65,4 @@ export const NavItem: React.FC = ({ href, icon: Icon, children, on
{children}
)
-}
\ No newline at end of file
+}
diff --git a/components/layout/sidebar.tsx b/components/layout/sidebar.tsx
index f45ec00..4dd16df 100644
--- a/components/layout/sidebar.tsx
+++ b/components/layout/sidebar.tsx
@@ -1,4 +1,4 @@
-"use client"
+"use client"
import { useState } from "react"
import Link from "next/link"
diff --git a/components/layout/theme-provider.tsx b/components/layout/theme-provider.tsx
index 32797a7..873e1de 100644
--- a/components/layout/theme-provider.tsx
+++ b/components/layout/theme-provider.tsx
@@ -1,4 +1,4 @@
-"use client"
+"use client"
import { ThemeProvider as NextThemesProvider } from "next-themes"
import type { ThemeProviderProps } from "next-themes"
diff --git a/components/modals/broadcast-dialog.tsx b/components/modals/broadcast-dialog.tsx
index 9880914..7920fe0 100644
--- a/components/modals/broadcast-dialog.tsx
+++ b/components/modals/broadcast-dialog.tsx
@@ -1,4 +1,4 @@
-"use client";
+"use client";
import { useState, useRef } from "react";
import { Button } from "@/components/ui/button";
@@ -350,4 +350,4 @@ __italic text__
);
-}
\ No newline at end of file
+}
diff --git a/components/modals/image-viewer-modal.tsx b/components/modals/image-viewer-modal.tsx
index 269a56d..3caa98d 100644
--- a/components/modals/image-viewer-modal.tsx
+++ b/components/modals/image-viewer-modal.tsx
@@ -1,4 +1,4 @@
-import { Dialog, DialogContent } from "@/components/ui/dialog";
+import { Dialog, DialogContent } from "@/components/ui/dialog";
import { ChevronLeft, ChevronRight, X } from "lucide-react";
import { Button } from "@/components/ui/button";
import { useEffect } from "react";
@@ -96,4 +96,4 @@ export function ImageViewerModal({ isOpen, onClose, imageUrl, onNavigate }: Imag
);
-}
\ No newline at end of file
+}
diff --git a/components/modals/import-products-modal.tsx b/components/modals/import-products-modal.tsx
index d45408e..1699b9d 100644
--- a/components/modals/import-products-modal.tsx
+++ b/components/modals/import-products-modal.tsx
@@ -1,4 +1,4 @@
-"use client";
+"use client";
import { useState } from "react";
import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogFooter } from "@/components/ui/dialog";
@@ -65,7 +65,7 @@ export default function ImportProductsModal({ open, setOpen, onImportComplete }:
const [name] = productInfo.split("\n");
if (!name) continue;
- const [category, subcategory] = productInfo.split("\n")[1].split("•")[0].split("->")
+ const [category, subcategory] = productInfo.split("\n")[1].split("ÔÇó")[0].split("->")
.map(item => item.trim());
if (!category || !subcategory) continue;
@@ -193,4 +193,4 @@ export default function ImportProductsModal({ open, setOpen, onImportComplete }:
);
-}
\ No newline at end of file
+}
diff --git a/components/modals/product-modal.tsx b/components/modals/product-modal.tsx
index dda246b..ca12289 100644
--- a/components/modals/product-modal.tsx
+++ b/components/modals/product-modal.tsx
@@ -1,4 +1,4 @@
-"use client";
+"use client";
import { useState, useEffect } from "react";
import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogFooter } from "@/components/ui/dialog";
@@ -320,7 +320,7 @@ const ProductBasicInfo: React.FC<{
-
💰 Cost & Profit Tracking
+
ƒÆ░ Cost & Profit Tracking
Track your costs to automatically calculate profit margins and markup percentages.
@@ -474,4 +474,4 @@ const UnitTypeSelect: React.FC<{
-);
\ No newline at end of file
+);
diff --git a/components/modals/product-selector.tsx b/components/modals/product-selector.tsx
index b32a282..ab4ddd2 100644
--- a/components/modals/product-selector.tsx
+++ b/components/modals/product-selector.tsx
@@ -1,4 +1,4 @@
-"use client";
+"use client";
import { useState, useEffect } from "react";
import { Button } from "@/components/ui/button";
@@ -127,4 +127,4 @@ export default function ProductSelector({ selectedProducts, onSelectionChange }:
)}
);
-}
\ No newline at end of file
+}
diff --git a/components/modals/profit-analysis-modal.tsx b/components/modals/profit-analysis-modal.tsx
index 83e04fd..c91f2b8 100644
--- a/components/modals/profit-analysis-modal.tsx
+++ b/components/modals/profit-analysis-modal.tsx
@@ -1,4 +1,4 @@
-"use client";
+"use client";
import { useState, useEffect } from "react";
import { Dialog, DialogContent, DialogHeader, DialogTitle } from "@/components/ui/dialog";
diff --git a/components/modals/shipping-modal.tsx b/components/modals/shipping-modal.tsx
index c8af667..ecaedf8 100644
--- a/components/modals/shipping-modal.tsx
+++ b/components/modals/shipping-modal.tsx
@@ -1,4 +1,4 @@
-"use client";
+"use client";
import { ChangeEvent, FormEvent } from "react";
import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogFooter } from "@/components/ui/dialog";
@@ -9,7 +9,7 @@ import { ShippingData } from "@/lib/types";
interface ShippingModalProps {
open: boolean;
onClose: () => void;
- onSave: (shippingData: ShippingData) => void; // ✅ Allow passing shippingData
+ onSave: (shippingData: ShippingData) => void; //  Allow passing shippingData
shippingData: ShippingData;
setShippingData: React.Dispatch>;
editing: boolean;
diff --git a/components/snow-loader.tsx b/components/snow-loader.tsx
index ac43f56..8b16b5e 100644
--- a/components/snow-loader.tsx
+++ b/components/snow-loader.tsx
@@ -1,4 +1,4 @@
-"use client"
+"use client"
import { useEffect, useState } from "react"
import { isDecember } from "@/lib/utils/christmas"
@@ -45,7 +45,7 @@ export function SnowLoader({ className = "", count = 20 }: SnowLoaderProps) {
fontSize: `${flake.size}rem`,
}}
>
- ❄
+ ÔØä
))}
diff --git a/components/theme-switcher.tsx b/components/theme-switcher.tsx
index 9500b86..002d1a5 100644
--- a/components/theme-switcher.tsx
+++ b/components/theme-switcher.tsx
@@ -1,4 +1,4 @@
-"use client";
+"use client";
import { useTheme } from "next-themes";
import { useEffect, useState } from "react";
@@ -27,4 +27,4 @@ export function ThemeSwitcher() {
)}
);
-}
\ No newline at end of file
+}
diff --git a/components/theme-toggle.tsx b/components/theme-toggle.tsx
index 0133f54..287c550 100644
--- a/components/theme-toggle.tsx
+++ b/components/theme-toggle.tsx
@@ -1,4 +1,4 @@
-"use client"
+"use client"
import * as React from "react"
import { Moon, Sun } from "lucide-react"
diff --git a/components/ui/accordion.tsx b/components/ui/accordion.tsx
index 070c70f..9897b05 100644
--- a/components/ui/accordion.tsx
+++ b/components/ui/accordion.tsx
@@ -1,4 +1,4 @@
-"use client"
+"use client"
import * as React from "react"
import * as AccordionPrimitive from "@radix-ui/react-accordion"
diff --git a/components/ui/alert-dialog.tsx b/components/ui/alert-dialog.tsx
index 81f54b8..889ec71 100644
--- a/components/ui/alert-dialog.tsx
+++ b/components/ui/alert-dialog.tsx
@@ -1,4 +1,4 @@
-"use client"
+"use client"
import * as React from "react"
import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog"
diff --git a/components/ui/alert.tsx b/components/ui/alert.tsx
index 06df060..ab29656 100644
--- a/components/ui/alert.tsx
+++ b/components/ui/alert.tsx
@@ -1,4 +1,4 @@
-import * as React from "react"
+import * as React from "react"
import { cva, type VariantProps } from "class-variance-authority"
import { cn } from "@/lib/utils/styles";
diff --git a/components/ui/avatar.tsx b/components/ui/avatar.tsx
index 72d04dd..9b2ba85 100644
--- a/components/ui/avatar.tsx
+++ b/components/ui/avatar.tsx
@@ -1,4 +1,4 @@
-"use client"
+"use client"
import * as React from "react"
import * as AvatarPrimitive from "@radix-ui/react-avatar"
diff --git a/components/ui/badge.tsx b/components/ui/badge.tsx
index 480294f..c776257 100644
--- a/components/ui/badge.tsx
+++ b/components/ui/badge.tsx
@@ -1,4 +1,4 @@
-import * as React from "react";
+import * as React from "react";
import { cva, type VariantProps } from "class-variance-authority";
import { cn } from "@/lib/utils/styles";
@@ -35,4 +35,4 @@ function Badge({ className, variant, ...props }: BadgeProps) {
);
}
-export { Badge, badgeVariants };
\ No newline at end of file
+export { Badge, badgeVariants };
diff --git a/components/ui/breadcrumb.tsx b/components/ui/breadcrumb.tsx
index 532f09c..250192d 100644
--- a/components/ui/breadcrumb.tsx
+++ b/components/ui/breadcrumb.tsx
@@ -1,4 +1,4 @@
-import * as React from "react"
+import * as React from "react"
import { Slot } from "@radix-ui/react-slot"
import { ChevronRight, MoreHorizontal } from "lucide-react"
diff --git a/components/ui/button.tsx b/components/ui/button.tsx
index 25790d0..d187fc7 100644
--- a/components/ui/button.tsx
+++ b/components/ui/button.tsx
@@ -1,4 +1,4 @@
-import * as React from "react"
+import * as React from "react"
import { Slot } from "@radix-ui/react-slot"
import { cva, type VariantProps } from "class-variance-authority"
diff --git a/components/ui/calendar.tsx b/components/ui/calendar.tsx
index 990feca..cba3784 100644
--- a/components/ui/calendar.tsx
+++ b/components/ui/calendar.tsx
@@ -1,4 +1,4 @@
-"use client"
+"use client"
import * as React from "react"
import { ChevronLeft, ChevronRight } from "lucide-react"
diff --git a/components/ui/card.tsx b/components/ui/card.tsx
index b39c5a6..35b1e96 100644
--- a/components/ui/card.tsx
+++ b/components/ui/card.tsx
@@ -1,4 +1,4 @@
-import * as React from "react"
+import * as React from "react"
import { cn } from "@/lib/utils/general"
diff --git a/components/ui/carousel.tsx b/components/ui/carousel.tsx
index 3bb8c21..6fd2c92 100644
--- a/components/ui/carousel.tsx
+++ b/components/ui/carousel.tsx
@@ -1,4 +1,4 @@
-"use client"
+"use client"
import * as React from "react"
import useEmblaCarousel, {
diff --git a/components/ui/chart.tsx b/components/ui/chart.tsx
index d621d11..6f4b30e 100644
--- a/components/ui/chart.tsx
+++ b/components/ui/chart.tsx
@@ -1,4 +1,4 @@
-"use client"
+"use client"
import * as React from "react"
import * as RechartsPrimitive from "recharts"
diff --git a/components/ui/checkbox.tsx b/components/ui/checkbox.tsx
index b0171aa..01bf9b5 100644
--- a/components/ui/checkbox.tsx
+++ b/components/ui/checkbox.tsx
@@ -1,4 +1,4 @@
-"use client"
+"use client"
import * as React from "react"
import * as CheckboxPrimitive from "@radix-ui/react-checkbox"
diff --git a/components/ui/collapsible.tsx b/components/ui/collapsible.tsx
index 9fa4894..52b6e4c 100644
--- a/components/ui/collapsible.tsx
+++ b/components/ui/collapsible.tsx
@@ -1,4 +1,4 @@
-"use client"
+"use client"
import * as CollapsiblePrimitive from "@radix-ui/react-collapsible"
diff --git a/components/ui/command.tsx b/components/ui/command.tsx
index 73d036c..e00f393 100644
--- a/components/ui/command.tsx
+++ b/components/ui/command.tsx
@@ -1,4 +1,4 @@
-"use client"
+"use client"
import * as React from "react"
import { type DialogProps } from "@radix-ui/react-dialog"
diff --git a/components/ui/context-menu.tsx b/components/ui/context-menu.tsx
index 125f11d..2984e24 100644
--- a/components/ui/context-menu.tsx
+++ b/components/ui/context-menu.tsx
@@ -1,4 +1,4 @@
-"use client"
+"use client"
import * as React from "react"
import * as ContextMenuPrimitive from "@radix-ui/react-context-menu"
diff --git a/components/ui/date-picker.tsx b/components/ui/date-picker.tsx
index ef7d11c..04e9d28 100644
--- a/components/ui/date-picker.tsx
+++ b/components/ui/date-picker.tsx
@@ -1,4 +1,4 @@
-"use client"
+"use client"
import * as React from "react"
import { format, addDays, startOfDay, endOfDay, isSameDay, isWithinInterval, getMonth, getYear, setMonth, setYear } from "date-fns"
@@ -410,4 +410,4 @@ export function DateRangeDisplay({ dateRange }: { dateRange?: DateRange }) {
)
-}
\ No newline at end of file
+}
diff --git a/components/ui/dialog.tsx b/components/ui/dialog.tsx
index 442fb65..b43a8a0 100644
--- a/components/ui/dialog.tsx
+++ b/components/ui/dialog.tsx
@@ -1,4 +1,4 @@
-"use client"
+"use client"
import * as React from "react"
import * as DialogPrimitive from "@radix-ui/react-dialog"
diff --git a/components/ui/drawer.tsx b/components/ui/drawer.tsx
index e91bd4b..07a5bb3 100644
--- a/components/ui/drawer.tsx
+++ b/components/ui/drawer.tsx
@@ -1,4 +1,4 @@
-"use client"
+"use client"
import * as React from "react"
import { Drawer as DrawerPrimitive } from "vaul"
diff --git a/components/ui/dropdown-menu.tsx b/components/ui/dropdown-menu.tsx
index b295e2a..d5d13ad 100644
--- a/components/ui/dropdown-menu.tsx
+++ b/components/ui/dropdown-menu.tsx
@@ -1,4 +1,4 @@
-"use client"
+"use client"
import * as React from "react"
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu"
diff --git a/components/ui/form.tsx b/components/ui/form.tsx
index 7b8d7e7..139e992 100644
--- a/components/ui/form.tsx
+++ b/components/ui/form.tsx
@@ -1,4 +1,4 @@
-"use client"
+"use client"
import * as React from "react"
import * as LabelPrimitive from "@radix-ui/react-label"
diff --git a/components/ui/input.tsx b/components/ui/input.tsx
index 8be3061..8e45814 100644
--- a/components/ui/input.tsx
+++ b/components/ui/input.tsx
@@ -1,4 +1,4 @@
-import * as React from "react"
+import * as React from "react"
import { cn } from "@/lib/utils/styles";
diff --git a/components/ui/label.tsx b/components/ui/label.tsx
index f61b3bf..0adbb1d 100644
--- a/components/ui/label.tsx
+++ b/components/ui/label.tsx
@@ -1,4 +1,4 @@
-"use client"
+"use client"
import * as React from "react"
import * as LabelPrimitive from "@radix-ui/react-label"
diff --git a/components/ui/menubar.tsx b/components/ui/menubar.tsx
index 1e067c8..7d5ccb0 100644
--- a/components/ui/menubar.tsx
+++ b/components/ui/menubar.tsx
@@ -1,4 +1,4 @@
-"use client"
+"use client"
import * as React from "react"
import * as MenubarPrimitive from "@radix-ui/react-menubar"
diff --git a/components/ui/navigation-menu.tsx b/components/ui/navigation-menu.tsx
index c084a57..4ac662e 100644
--- a/components/ui/navigation-menu.tsx
+++ b/components/ui/navigation-menu.tsx
@@ -1,4 +1,4 @@
-import * as React from "react"
+import * as React from "react"
import * as NavigationMenuPrimitive from "@radix-ui/react-navigation-menu"
import { cva } from "class-variance-authority"
import { ChevronDown } from "lucide-react"
diff --git a/components/ui/pagination.tsx b/components/ui/pagination.tsx
index 9ad1c59..ae71b17 100644
--- a/components/ui/pagination.tsx
+++ b/components/ui/pagination.tsx
@@ -1,4 +1,4 @@
-import * as React from "react"
+import * as React from "react"
import { ChevronLeft, ChevronRight, MoreHorizontal } from "lucide-react"
import { cn } from "@/lib/utils/styles";
diff --git a/components/ui/popover.tsx b/components/ui/popover.tsx
index d128d6e..72da2de 100644
--- a/components/ui/popover.tsx
+++ b/components/ui/popover.tsx
@@ -1,4 +1,4 @@
-"use client"
+"use client"
import * as React from "react"
import * as PopoverPrimitive from "@radix-ui/react-popover"
diff --git a/components/ui/progress.tsx b/components/ui/progress.tsx
index 0d401fd..f69ad17 100644
--- a/components/ui/progress.tsx
+++ b/components/ui/progress.tsx
@@ -1,4 +1,4 @@
-"use client"
+"use client"
import * as React from "react"
import * as ProgressPrimitive from "@radix-ui/react-progress"
diff --git a/components/ui/radio-group.tsx b/components/ui/radio-group.tsx
index 9726319..908a9ee 100644
--- a/components/ui/radio-group.tsx
+++ b/components/ui/radio-group.tsx
@@ -1,4 +1,4 @@
-"use client"
+"use client"
import * as React from "react"
import * as RadioGroupPrimitive from "@radix-ui/react-radio-group"
diff --git a/components/ui/resizable.tsx b/components/ui/resizable.tsx
index d77f153..a79dcc0 100644
--- a/components/ui/resizable.tsx
+++ b/components/ui/resizable.tsx
@@ -1,4 +1,4 @@
-"use client"
+"use client"
import { GripVertical } from "lucide-react"
import * as ResizablePrimitive from "react-resizable-panels"
diff --git a/components/ui/scroll-area.tsx b/components/ui/scroll-area.tsx
index e625243..574e83a 100644
--- a/components/ui/scroll-area.tsx
+++ b/components/ui/scroll-area.tsx
@@ -1,4 +1,4 @@
-"use client"
+"use client"
import * as React from "react"
import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area"
diff --git a/components/ui/select.tsx b/components/ui/select.tsx
index 13bca40..48d405e 100644
--- a/components/ui/select.tsx
+++ b/components/ui/select.tsx
@@ -1,4 +1,4 @@
-"use client"
+"use client"
import * as React from "react"
import * as SelectPrimitive from "@radix-ui/react-select"
diff --git a/components/ui/separator.tsx b/components/ui/separator.tsx
index b9930d9..04aab35 100644
--- a/components/ui/separator.tsx
+++ b/components/ui/separator.tsx
@@ -1,4 +1,4 @@
-"use client"
+"use client"
import * as React from "react"
import * as SeparatorPrimitive from "@radix-ui/react-separator"
diff --git a/components/ui/sheet.tsx b/components/ui/sheet.tsx
index 77f40f8..3dcfe86 100644
--- a/components/ui/sheet.tsx
+++ b/components/ui/sheet.tsx
@@ -1,4 +1,4 @@
-"use client"
+"use client"
import * as React from "react"
import * as SheetPrimitive from "@radix-ui/react-dialog"
diff --git a/components/ui/sidebar.tsx b/components/ui/sidebar.tsx
index bcea5c8..16f6787 100644
--- a/components/ui/sidebar.tsx
+++ b/components/ui/sidebar.tsx
@@ -1,4 +1,4 @@
-"use client"
+"use client"
import * as React from "react"
import { Slot } from "@radix-ui/react-slot"
diff --git a/components/ui/skeleton.tsx b/components/ui/skeleton.tsx
index 3e2b7d0..fee15e4 100644
--- a/components/ui/skeleton.tsx
+++ b/components/ui/skeleton.tsx
@@ -1,4 +1,4 @@
-import { cn } from "@/lib/utils/styles";
+import { cn } from "@/lib/utils/styles";
function Skeleton({
className,
diff --git a/components/ui/slider.tsx b/components/ui/slider.tsx
index f941aca..a800df8 100644
--- a/components/ui/slider.tsx
+++ b/components/ui/slider.tsx
@@ -1,4 +1,4 @@
-"use client"
+"use client"
import * as React from "react"
import * as SliderPrimitive from "@radix-ui/react-slider"
diff --git a/components/ui/switch.tsx b/components/ui/switch.tsx
index cb9279b..2c0fd53 100644
--- a/components/ui/switch.tsx
+++ b/components/ui/switch.tsx
@@ -1,4 +1,4 @@
-"use client"
+"use client"
import * as React from "react"
import * as SwitchPrimitives from "@radix-ui/react-switch"
diff --git a/components/ui/table.tsx b/components/ui/table.tsx
index b83bda8..32d1384 100644
--- a/components/ui/table.tsx
+++ b/components/ui/table.tsx
@@ -1,4 +1,4 @@
-import * as React from "react"
+import * as React from "react"
import { cn } from "@/lib/utils/styles";
diff --git a/components/ui/tabs.tsx b/components/ui/tabs.tsx
index ddf91f9..208a078 100644
--- a/components/ui/tabs.tsx
+++ b/components/ui/tabs.tsx
@@ -1,4 +1,4 @@
-"use client"
+"use client"
import * as React from "react"
import * as TabsPrimitive from "@radix-ui/react-tabs"
diff --git a/components/ui/textarea.tsx b/components/ui/textarea.tsx
index 89d213a..b4a9138 100644
--- a/components/ui/textarea.tsx
+++ b/components/ui/textarea.tsx
@@ -1,4 +1,4 @@
-import * as React from "react"
+import * as React from "react"
import { cn } from "@/lib/utils/styles";
diff --git a/components/ui/toast.tsx b/components/ui/toast.tsx
index 2d960fa..deb2af2 100644
--- a/components/ui/toast.tsx
+++ b/components/ui/toast.tsx
@@ -1,4 +1,4 @@
-"use client"
+"use client"
import * as React from "react"
import * as ToastPrimitives from "@radix-ui/react-toast"
diff --git a/components/ui/toggle-group.tsx b/components/ui/toggle-group.tsx
index e16c3dc..341a397 100644
--- a/components/ui/toggle-group.tsx
+++ b/components/ui/toggle-group.tsx
@@ -1,4 +1,4 @@
-"use client"
+"use client"
import * as React from "react"
import * as ToggleGroupPrimitive from "@radix-ui/react-toggle-group"
diff --git a/components/ui/toggle.tsx b/components/ui/toggle.tsx
index 9f76738..74251f8 100644
--- a/components/ui/toggle.tsx
+++ b/components/ui/toggle.tsx
@@ -1,4 +1,4 @@
-"use client"
+"use client"
import * as React from "react"
import * as TogglePrimitive from "@radix-ui/react-toggle"
diff --git a/components/ui/tooltip.tsx b/components/ui/tooltip.tsx
index 0c10cda..e52ca51 100644
--- a/components/ui/tooltip.tsx
+++ b/components/ui/tooltip.tsx
@@ -1,4 +1,4 @@
-"use client"
+"use client"
import * as React from "react"
import * as TooltipPrimitive from "@radix-ui/react-tooltip"
diff --git a/components/ui/use-toast.ts b/components/ui/use-toast.ts
index 02e111d..7c2e88c 100644
--- a/components/ui/use-toast.ts
+++ b/components/ui/use-toast.ts
@@ -1,4 +1,4 @@
-"use client"
+"use client"
// Inspired by react-hot-toast library
import * as React from "react"
diff --git a/lib/api-client.ts b/lib/api-client.ts
index 4052a60..a63bd85 100644
--- a/lib/api-client.ts
+++ b/lib/api-client.ts
@@ -377,6 +377,99 @@ export const getCustomerDetails = async (userId: string): Promise
return clientFetch(`/customers/${userId}`);
};
+/**
+ * Export orders by status to CSV
+ * @param status Order status to filter by
+ * @param storeId Optional store ID (uses authenticated user's store if not provided)
+ * @returns Promise that resolves when download is triggered
+ */
+export const exportOrdersToCSV = async (status: string, storeId?: string): Promise => {
+ try {
+ const apiUrl = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:3001';
+ const normalizedEndpoint = '/orders/export-csv';
+
+ // Handle API endpoint construction
+ let url;
+ if (apiUrl === '/api' || apiUrl.startsWith('/api')) {
+ url = `/api${normalizedEndpoint}`;
+ } else {
+ url = `${apiUrl}${normalizedEndpoint}`;
+ }
+
+ // Add query parameters
+ const params = new URLSearchParams({ status });
+ if (storeId) {
+ params.append('storeId', storeId);
+ }
+ url = `${url}?${params.toString()}`;
+
+ // Get auth token
+ const authToken = getAuthToken();
+
+ // Prepare headers
+ const headers: Record = {};
+ if (authToken && authToken !== 'HTTP_ONLY_COOKIE') {
+ headers['Authorization'] = `Bearer ${authToken}`;
+ }
+
+ // Fetch the CSV file
+ const response = await fetch(url, {
+ method: 'GET',
+ credentials: 'include',
+ headers,
+ });
+
+ if (!response.ok) {
+ const errorData = await response.json().catch(() => ({}));
+ const errorMessage = errorData.message || errorData.error || 'Failed to export orders';
+ throw new Error(errorMessage);
+ }
+
+ // Get the CSV content
+ const blob = await response.blob();
+
+ // Get filename from Content-Disposition header or generate one
+ const contentDisposition = response.headers.get('Content-Disposition');
+ let filename = `orders_${status}_${new Date().toISOString().split('T')[0]}.csv`;
+ if (contentDisposition) {
+ const filenameMatch = contentDisposition.match(/filename="?(.+)"?/);
+ if (filenameMatch) {
+ filename = filenameMatch[1];
+ }
+ }
+
+ // Create download link and trigger download
+ const downloadUrl = window.URL.createObjectURL(blob);
+ const link = document.createElement('a');
+ link.href = downloadUrl;
+ link.download = filename;
+ document.body.appendChild(link);
+ link.click();
+ document.body.removeChild(link);
+ window.URL.revokeObjectURL(downloadUrl);
+ } catch (error) {
+ console.error('Error exporting orders to CSV:', error);
+ const message = error instanceof Error ? error.message : 'Failed to export orders';
+
+ // Show error toast
+ if (typeof window !== 'undefined') {
+ if (toast?.title && toast?.description) {
+ toast({
+ title: 'Export Failed',
+ description: message,
+ variant: 'destructive',
+ });
+ } else if (typeof toast?.error === 'function') {
+ toast.error(message);
+ } else {
+ console.error('CSV export error:', message);
+ }
+ }
+
+ throw error;
+ }
+};
+
/**
* Enhanced client-side fetch function with caching and automatic invalidation
*/
diff --git a/lib/api.ts b/lib/api.ts
index d0c8743..ad0a165 100644
--- a/lib/api.ts
+++ b/lib/api.ts
@@ -10,6 +10,9 @@ export {
getCustomers,
getCustomerDetails,
+ // Orders API
+ exportOrdersToCSV,
+
// Types
type CustomerStats,
type CustomerResponse,
diff --git a/public/git-info.json b/public/git-info.json
index 97cfeba..6db9608 100644
--- a/public/git-info.json
+++ b/public/git-info.json
@@ -1,4 +1,4 @@
{
- "commitHash": "e7fcfd6",
- "buildTime": "2025-12-08T01:01:03.674Z"
+ "commitHash": "07dcaf5",
+ "buildTime": "2025-12-15T17:54:38.040Z"
}
\ No newline at end of file