Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
8a74ef2
feat: add usage-insight on the desktop-sidebar
revogabe Mar 13, 2025
f6bd0f6
remove console.log
revogabe Mar 13, 2025
772eeab
refactor: improve code consistency and formatting across multiple files
revogabe Mar 13, 2025
22db09b
Merge branch 'main' into billing-card-on-sidebar
revogabe Mar 13, 2025
9bd852b
Merge branch 'main' into billing-card-on-sidebar
revogabe Mar 13, 2025
209e03f
fix: keep only the progress circle, remove the particle effect, keep …
revogabe Mar 15, 2025
e3eb5a2
refactor: simplify layout and desktop sidebar components, remove unus…
revogabe Mar 18, 2025
12633de
feat(billing): add usage fetching hook and TRPC query for billing usa…
revogabe Mar 18, 2025
946d239
fix: update workspace creation logic to set plan to 'free' and improv…
revogabe Mar 18, 2025
5c0e690
fix: remove unnecessary console log for usage query fetching
revogabe Mar 18, 2025
26c6578
refactor: adjust padding and height in usage insights component for i…
revogabe Mar 18, 2025
0bde49b
Merge branch 'main' into billing-card-on-sidebar
revogabe Mar 18, 2025
667187b
fix: update plan type in usage insights to handle workspace tier and …
revogabe Mar 18, 2025
10e0549
[autofix.ci] apply automated fixes
autofix-ci[bot] Mar 18, 2025
c571c4f
refactor: improve code readability and formatting in usage insights c…
revogabe Mar 18, 2025
605dc3a
refactor: remove Particles component and relocate useMousePosition hook
revogabe Mar 18, 2025
4fc8d94
refactor: enhance code formatting and readability in desktop sidebar …
revogabe Mar 18, 2025
7fd608f
Merge branch 'main' into billing-card-on-sidebar
revogabe Mar 18, 2025
abddd9e
fix: remove use-mouse hook
revogabe Mar 18, 2025
0d17cf3
Merge branch 'main' into billing-card-on-sidebar
revogabe Mar 18, 2025
35273a1
pnpm fmt
revogabe Mar 19, 2025
a9bc268
Merge branch 'main' into billing-card-on-sidebar
ogzhanolguncu Mar 19, 2025
268cb9d
Merge branch 'main' into billing-card-on-sidebar
revogabe Mar 19, 2025
b3aa59e
pnpm-lock fix
revogabe Mar 19, 2025
c72b9ef
Merge branch 'main' into billing-card-on-sidebar
perkinsjr Mar 19, 2025
eab9dad
refactor: update usage insights to use 'tier' instead of 'plan' and s…
revogabe Mar 20, 2025
c7a1479
fix: remove outdated and wrong quota check (#3000)
chronark Mar 20, 2025
c0159dd
Update README.md (#3002)
kumachan99 Mar 20, 2025
d721af9
feat: sidebar (#3003)
ogzhanolguncu Mar 20, 2025
a41ec8a
fix: layout shifts and missing props (#3006)
ogzhanolguncu Mar 20, 2025
0a43ddf
refactor: clean up imports and improve layout component structure
revogabe Mar 21, 2025
82c97d5
pnpm fmt
revogabe Mar 21, 2025
25f8f86
Merge branch 'main' into billing-card-on-sidebar
revogabe Mar 21, 2025
8ceaace
Merge branch 'main' into billing-card-on-sidebar
revogabe Mar 21, 2025
7fa989b
refactor: simplify usage query options in useFetchUsage hook
revogabe Mar 21, 2025
ddd90ff
pnpm fmt
revogabe Mar 21, 2025
1cf6692
Merge branch 'main' into billing-card-on-sidebar
revogabe Mar 22, 2025
cd6acbf
Merge branch 'main' into billing-card-on-sidebar
ogzhanolguncu Mar 24, 2025
945f7f9
fix: broken lock
ogzhanolguncu Mar 24, 2025
e3b5658
Merge branch 'main' into billing-card-on-sidebar
revogabe Mar 27, 2025
d272de3
fix: quotas rename to quota
revogabe Mar 27, 2025
50917a0
feat: clean up usage banner
chronark Apr 8, 2025
e8901cc
fix: refetch usage
chronark Apr 8, 2025
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
6 changes: 5 additions & 1 deletion apps/dashboard/app/(app)/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export default async function Layout({ children }: LayoutProps) {
apis: {
where: (table, { isNull }) => isNull(table.deletedAtM),
},
quotas: true,
},
});

Expand All @@ -32,7 +33,10 @@ export default async function Layout({ children }: LayoutProps) {
<SidebarProvider>
<div className="flex flex-1 overflow-hidden">
{/* Desktop Sidebar */}
<AppSidebar workspace={workspace} className="bg-gray-1 border-grayA-4" />
<AppSidebar
workspace={{ ...workspace, quotas: workspace.quotas! }}
className="bg-gray-1 border-grayA-4"
/>

{/* Main content area */}
<div className="flex-1 overflow-auto">
Expand Down
8 changes: 4 additions & 4 deletions apps/dashboard/app/(app)/settings/billing/client.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ type Props = {
name: string;
priceId: string;
dollar: number;
quota: {
quotas: {
requestsPerMonth: number;
};
}>;
Expand Down Expand Up @@ -116,7 +116,7 @@ export const Client: React.FC<Props> = (props) => {
>
<div className=" text-accent-12 font-medium w-4/12">{p.name}</div>
<div className="w-4/12 flex justify-end items-center gap-1">
<span className="text-accent-12 ">{formatNumber(p.quota.requestsPerMonth)}</span>
<span className="text-accent-12 ">{formatNumber(p.quotas.requestsPerMonth)}</span>
<span className="text-gray-11 ">requests</span>
</div>
<div className="flex items-center justify-between gap-4 w-4/12">
Expand All @@ -131,7 +131,7 @@ export const Client: React.FC<Props> = (props) => {
description={`Changing to ${
p.name
} updates your request quota to ${formatNumber(
p.quota.requestsPerMonth,
p.quotas.requestsPerMonth,
)} per month immediately.`}
onConfirm={async () =>
updateSubscription.mutateAsync({
Expand All @@ -151,7 +151,7 @@ export const Client: React.FC<Props> = (props) => {
description={`Changing to ${
p.name
} updates your request quota to ${formatNumber(
p.quota.requestsPerMonth,
p.quotas.requestsPerMonth,
)} per month immediately.`}
onConfirm={() => createSubscription.mutateAsync({ productId: p.id })}
fineprint={
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@ function clamp(min: number, value: number, max: number): number {
return Math.min(max, Math.max(value, min));
}

const ProgressCircle: React.FC<{ value: number; max: number }> = ({ value, max }) => {
export const ProgressCircle: React.FC<{
value: number;
max: number;
color?: string;
}> = ({ value, max, color }) => {
const safeValue = clamp(0, value, max);
const radius = 12;
const strokeWidth = 3;
Expand Down Expand Up @@ -65,6 +69,7 @@ const ProgressCircle: React.FC<{ value: number; max: number }> = ({ value, max }
stroke=""
strokeLinecap="round"
className="stroke-accent-12 transform-gpu transition-all duration-300 ease-in-out"
style={{ stroke: color }}
/>
) : null}
</svg>
Expand Down
6 changes: 3 additions & 3 deletions apps/dashboard/app/(app)/settings/billing/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export default async function BillingPage() {
const workspace = await db.query.workspaces.findFirst({
where: (table, { and, eq, isNull }) => and(eq(table.orgId, orgId), isNull(table.deletedAtM)),
with: {
quota: true,
quotas: true,
},
});

Expand Down Expand Up @@ -137,7 +137,7 @@ export default async function BillingPage() {
name: p.name,
priceId: price.id,
dollar: price.unit_amount! / 100,
quota: {
quotas: {
requestsPerMonth: Number.parseInt(p.metadata.quota_requests_per_month),
},
};
Expand Down Expand Up @@ -165,7 +165,7 @@ export default async function BillingPage() {
products={products}
usage={{
current: usedVerifications + usedRatelimits,
max: workspace.quota?.requestsPerMonth ?? 150_000,
max: workspace.quotas?.requestsPerMonth ?? 150_000,
}}
subscription={
subscription
Expand Down
4 changes: 2 additions & 2 deletions apps/dashboard/app/(app)/settings/team/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ export default async function SettingTeamPage() {
const orgId = await getOrgId();
const ws = await db.query.workspaces.findFirst({
where: (table, { and, eq, isNull }) => and(eq(table.orgId, orgId), isNull(table.deletedAtM)),
with: { quota: true },
with: { quotas: true },
});

const team = ws?.quota?.team ?? false;
const team = ws?.quotas?.team ?? false;

return (
<div>
Expand Down
Loading
Loading