Skip to content

Commit 1019ba0

Browse files
committed
feat: Improved createdAt and updatedAt visualisation
1 parent 6b25bbe commit 1019ba0

15 files changed

Lines changed: 312 additions & 237 deletions

File tree

apps/web/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
"@uiw/react-codemirror": "^4.25.3",
3838
"@xyflow/react": "^12.9.3",
3939
"dagre": "^0.8.5",
40+
"dayjs": "^1.11.19",
4041
"framer-motion": "^12.23.24",
4142
"juice": "^11.0.3",
4243
"lucide-react": "^0.553.0",

apps/web/src/components/BillingLimits.tsx

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {memo, useCallback, useEffect, useMemo, useState} from 'react';
1+
import {memo, useEffect, useMemo, useState} from 'react';
22
import {useForm} from 'react-hook-form';
33
import {zodResolver} from '@hookform/resolvers/zod';
44
import {BillingLimitSchemas} from '@plunk/shared';
@@ -23,7 +23,7 @@ import {
2323
import {AlertCircle, AlertTriangle, Check} from 'lucide-react';
2424
import {AnimatePresence, motion} from 'framer-motion';
2525
import type {z} from 'zod';
26-
import {useBillingLimits, type BillingLimitsData, type CategoryLimit} from '../lib/hooks/useBillingLimits';
26+
import {type BillingLimitsData, type CategoryLimit, useBillingLimits} from '../lib/hooks/useBillingLimits';
2727
import {network} from '../lib/network';
2828

2929
// Price per email in the smallest currency unit (e.g., cents for USD/EUR)
@@ -50,7 +50,7 @@ const formatEmailCost = (emailCount: number, currency: string | null): string =>
5050
minimumFractionDigits: 2,
5151
maximumFractionDigits: 2,
5252
}).format(costInCents / 100);
53-
} catch (error) {
53+
} catch {
5454
// Fallback if currency is invalid
5555
return `${(costInCents / 100).toFixed(2)} ${currency.toUpperCase()}`;
5656
}
@@ -167,8 +167,8 @@ export function BillingLimits({projectId, hasSubscription, billingEnabled}: Bill
167167
<AlertCircle className="h-4 w-4" />
168168
<div className="ml-2">
169169
<p className="text-sm">
170-
You&apos;re on the free tier with 1,000 emails per month. Upgrade to a paid subscription for
171-
unlimited emails or custom limits.
170+
You&apos;re on the free tier with 1,000 emails per month. Upgrade to a paid subscription for unlimited
171+
emails or custom limits.
172172
</p>
173173
</div>
174174
</Alert>
@@ -254,9 +254,7 @@ export function BillingLimits({projectId, hasSubscription, billingEnabled}: Bill
254254
</FormControl>
255255
<FormDescription>
256256
Maximum workflow emails per month. Leave empty for unlimited.
257-
{estimatedCost && (
258-
<span className="text-neutral-500">{estimatedCost}/month</span>
259-
)}
257+
{estimatedCost && <span className="text-neutral-500">{estimatedCost}/month</span>}
260258
</FormDescription>
261259
<FormMessage />
262260
</FormItem>
@@ -286,9 +284,7 @@ export function BillingLimits({projectId, hasSubscription, billingEnabled}: Bill
286284
</FormControl>
287285
<FormDescription>
288286
Maximum campaign emails per month. Leave empty for unlimited.
289-
{estimatedCost && (
290-
<span className="text-neutral-500">{estimatedCost}/month</span>
291-
)}
287+
{estimatedCost && <span className="text-neutral-500">{estimatedCost}/month</span>}
292288
</FormDescription>
293289
<FormMessage />
294290
</FormItem>
@@ -318,9 +314,7 @@ export function BillingLimits({projectId, hasSubscription, billingEnabled}: Bill
318314
</FormControl>
319315
<FormDescription>
320316
Maximum transactional emails per month. Leave empty for unlimited.
321-
{estimatedCost && (
322-
<span className="text-neutral-500">{estimatedCost}/month</span>
323-
)}
317+
{estimatedCost && <span className="text-neutral-500">{estimatedCost}/month</span>}
324318
</FormDescription>
325319
<FormMessage />
326320
</FormItem>

0 commit comments

Comments
 (0)