Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 37 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions src/app/api/store/[slug]/orders/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@ function generateOrderNumber(): string {
* Format currency for display
*/
function formatCurrency(amount: number, currency: string = 'BDT'): string {
return new Intl.NumberFormat('en-US', {
style: 'currency',
currency,
return 'BDT ' + new Intl.NumberFormat('en-US', {
minimumFractionDigits: 2,
maximumFractionDigits: 2,
}).format(amount);
}

Expand Down
6 changes: 5 additions & 1 deletion src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@ export const metadata: Metadata = {
keywords: ["Next.js", "React", "TypeScript", "SaaS", "Multi-tenant", "Authentication"],
authors: [{ name: "StormCom Team" }],
creator: "StormCom",
metadataBase: new URL(process.env.NEXTAUTH_URL || "http://localhost:3000"),
metadataBase: new URL(
(typeof process.env.NEXTAUTH_URL === 'string' && process.env.NEXTAUTH_URL.length > 0)
? process.env.NEXTAUTH_URL.replace(/^["']|["']$/g, '').trim()
: "http://localhost:3000"
),
openGraph: {
type: "website",
locale: "en_US",
Expand Down
4 changes: 1 addition & 3 deletions src/components/analytics-dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,7 @@ export function AnalyticsDashboard({ storeId, dateRange }: AnalyticsDashboardPro

// Format currency
const formatCurrency = (amount: number) => {
return new Intl.NumberFormat('en-US', {
style: 'currency',
currency: 'BDT',
return 'BDT ' + new Intl.NumberFormat('en-US', {
minimumFractionDigits: 2,
maximumFractionDigits: 2,
}).format(amount);
Expand Down
6 changes: 3 additions & 3 deletions src/components/analytics/analytics-dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,9 @@ export function AnalyticsDashboard({ storeId: propStoreId }: AnalyticsDashboardP
}, [timeRange, storeId]);

const formatCurrency = (value: number) => {
return new Intl.NumberFormat('en-US', {
style: 'currency',
currency: 'BDT',
return 'BDT ' + new Intl.NumberFormat('en-US', {
minimumFractionDigits: 2,
maximumFractionDigits: 2,
}).format(value);
};

Expand Down
6 changes: 3 additions & 3 deletions src/components/analytics/customer-metrics.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@ export function CustomerMetrics({ storeId, timeRange }: CustomerMetricsProps) {

const formatCurrency = (value: number | undefined | null) => {
if (value === null || value === undefined) return 'BDT 0.00';
return new Intl.NumberFormat('en-US', {
style: 'currency',
currency: 'BDT',
return 'BDT ' + new Intl.NumberFormat('en-US', {
minimumFractionDigits: 2,
maximumFractionDigits: 2,
}).format(value);
};

Expand Down
5 changes: 2 additions & 3 deletions src/components/analytics/revenue-chart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,9 @@ export function RevenueChart({ storeId, timeRange }: RevenueChartProps) {
}

const formatCurrency = (value: number) => {
return new Intl.NumberFormat('en-US', {
style: 'currency',
currency: 'BDT',
return 'BDT ' + new Intl.NumberFormat('en-US', {
minimumFractionDigits: 0,
maximumFractionDigits: 0,
}).format(value);
};

Expand Down
5 changes: 2 additions & 3 deletions src/components/analytics/top-products-table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,9 @@ export function TopProductsTable({ storeId, timeRange }: TopProductsTableProps)
}, [storeId, timeRange]);

const formatCurrency = (value: number) => {
return new Intl.NumberFormat('en-US', {
style: 'currency',
currency: 'BDT',
return 'BDT ' + new Intl.NumberFormat('en-US', {
minimumFractionDigits: 0,
maximumFractionDigits: 0,
}).format(value);
};

Expand Down
6 changes: 3 additions & 3 deletions src/components/customers/customer-detail-dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ export function CustomerDetailDialog({
onOpenChange,
}: CustomerDetailDialogProps) {
const formatCurrency = (value: number) => {
return new Intl.NumberFormat('en-US', {
style: 'currency',
currency: 'BDT',
return 'BDT ' + new Intl.NumberFormat('en-US', {
minimumFractionDigits: 2,
maximumFractionDigits: 2,
}).format(value);
};

Expand Down
Loading
Loading