Skip to content

Commit 4e0926b

Browse files
committed
add started sandboxes count
1 parent 898b78a commit 4e0926b

5 files changed

Lines changed: 27 additions & 3 deletions

File tree

src/features/dashboard/templates/detail/overview/index.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import { useSuspenseQuery } from '@tanstack/react-query'
44
import { useTRPC } from '@/trpc/client'
55
import { LatestBuildSection } from './latest-build-section'
6+
import { SandboxesStartedSection } from './sandboxes-started-section'
67
import { TemplateSection } from './template-section'
78

89
interface TemplateOverviewProps {
@@ -26,6 +27,7 @@ export default function TemplateOverview({
2627
<div className="flex flex-col gap-8">
2728
<TemplateSection template={template} teamSlug={teamSlug} />
2829
<LatestBuildSection templateId={templateId} teamSlug={teamSlug} />
30+
<SandboxesStartedSection spawnCount={template.spawnCount} />
2931
</div>
3032
)
3133
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { formatNumber } from '@/lib/utils/formatting'
2+
import { OverviewSection } from './section'
3+
4+
interface SandboxesStartedSectionProps {
5+
spawnCount: number
6+
}
7+
8+
export function SandboxesStartedSection({
9+
spawnCount,
10+
}: SandboxesStartedSectionProps) {
11+
return (
12+
<OverviewSection label="Sandboxes started">
13+
<span className="prose-value-big font-mono uppercase text-fg whitespace-nowrap">
14+
{formatNumber(spawnCount)}
15+
</span>
16+
</OverviewSection>
17+
)
18+
}

src/features/dashboard/templates/detail/overview/section.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export function OverviewSection({
2525
)}
2626
>
2727
<div className="flex items-center gap-2">
28-
<span className="text-fg-tertiary prose-label uppercase">{label}</span>
28+
<span className="text-fg prose-label-highlight uppercase">{label}</span>
2929
{labelBadge}
3030
</div>
3131
<div className="flex flex-col gap-3">{children}</div>

src/features/dashboard/templates/detail/overview/skeleton.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ export function TemplateOverviewSkeleton() {
1919
</div>
2020
<Skeleton className="h-5 w-80 mt-2 max-w-full" />
2121
</OverviewSection>
22+
23+
<OverviewSection label="Sandboxes started">
24+
<Skeleton className="h-8 w-20" />
25+
</OverviewSection>
2226
</div>
2327
)
2428
}

src/features/dashboard/templates/detail/overview/template-specs.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { formatNumber } from '@/lib/utils/formatting'
22
import { cn } from '@/lib/utils/ui'
33
import {
4-
CodeChevronIcon,
54
CpuIcon,
65
MemoryIcon,
6+
MetadataIcon,
77
StorageIcon,
88
} from '@/ui/primitives/icons'
99

@@ -54,7 +54,7 @@ export function TemplateSpecs({ build, className }: TemplateSpecsProps) {
5454
{build.envdVersion && (
5555
<>
5656
<Separator />
57-
<SpecItem icon={<CodeChevronIcon className="size-3.5" />}>
57+
<SpecItem icon={<MetadataIcon className="size-3.5" />}>
5858
<span className="prose-body-numeric-highlight font-mono">
5959
{build.envdVersion}
6060
</span>

0 commit comments

Comments
 (0)