Skip to content
Open
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
75 changes: 36 additions & 39 deletions frontend/app/src/pages/main/v1/managed-workers/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@ import { BillingRequired } from './components/billing-required';
import { ManagedWorkersTable } from './components/managed-workers-table';
import { MonthlyUsageCard } from './components/monthly-usage-card';
import { Button } from '@/components/v1/ui/button';
import {
Dialog,
DialogContent,
DialogDescription,
DialogFooter,
DialogHeader,
DialogTitle,
} from '@/components/v1/ui/dialog';
import { Spinner } from '@/components/v1/ui/loading';
import { Separator } from '@/components/v1/ui/separator';
import { useCurrentTenantId, useTenantDetails } from '@/hooks/use-tenant';
Expand Down Expand Up @@ -118,44 +126,6 @@ export default function ManagedWorkers() {
}
};

const UpgradeModal = () => {
if (!showUpgradeModal) {
return null;
}

return (
// TODO use correct modal component
<div className="fixed inset-0 z-50 flex items-center justify-center bg-black/50 dark:bg-black/70">
<div className="w-full max-w-md rounded-lg border border-border bg-background p-6 shadow-lg">
<h3 className="mb-4 text-lg font-medium text-foreground">
Plan Upgrade Required
</h3>
<p className="mb-4 text-muted-foreground">
You've reached the maximum number of services ({workerPoolCount}/
{getWorkerPoolLimit()}) allowed on your current plan. Upgrade to
create more services.
</p>
<div className="flex justify-end gap-3">
<Button
variant="outline"
onClick={() => setShowUpgradeModal(false)}
>
Cancel
</Button>
<Link
to={appRoutes.tenantSettingsBillingRoute.to}
params={{ tenant: tenantId }}
>
<Button leftIcon={<ArrowUpIcon className="size-4" />}>
Upgrade Plan
</Button>
</Link>
</div>
</div>
</div>
);
};

return (
<div className="h-full w-full flex-grow">
<div className="mx-auto px-4 py-8 sm:px-6 lg:px-8">
Expand Down Expand Up @@ -194,7 +164,34 @@ export default function ManagedWorkers() {
/>
</div>
</div>
<UpgradeModal />
<Dialog open={showUpgradeModal} onOpenChange={setShowUpgradeModal}>
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the refactor here! Any chance you can post a screenshot of a before and after for these changes? I'd like to see how the UI changes now that we're using these internal components.

Copy link
Copy Markdown
Contributor Author

@jishnundth jishnundth May 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

It's the same only, the popup looks little more wider now. This is not visible in the OSS version, you've to override some variables to see managed compute on the sidebar, where this is located.

<DialogContent className="max-w-md">
<DialogHeader>
<DialogTitle>Plan Upgrade Required</DialogTitle>
<DialogDescription>
You've reached the maximum number of services ({workerPoolCount}/
{getWorkerPoolLimit()}) allowed on your current plan. Upgrade to
create more services.
</DialogDescription>
</DialogHeader>
<DialogFooter>
<Button
variant="outline"
onClick={() => setShowUpgradeModal(false)}
>
Cancel
</Button>
<Link
to={appRoutes.tenantSettingsBillingRoute.to}
params={{ tenant: tenantId }}
>
<Button leftIcon={<ArrowUpIcon className="size-4" />}>
Upgrade Plan
</Button>
</Link>
</DialogFooter>
</DialogContent>
</Dialog>
</div>
);
}
Loading