Skip to content

Commit cc1cdc4

Browse files
committed
improve: inspect fetch caching and streaming structure
1 parent 5ad3589 commit cc1cdc4

3 files changed

Lines changed: 19 additions & 20 deletions

File tree

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { default } from '@/features/dashboard/loading-layout'

src/app/dashboard/[teamIdOrSlug]/sandboxes/[sandboxId]/inspect/page.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ import { resolveTeamIdInServerComponent } from '@/lib/utils/server'
55
import { getSandboxRoot } from '@/server/sandboxes/get-sandbox-root'
66
import { notFound } from 'next/navigation'
77

8+
export const dynamic = 'force-dynamic'
9+
export const fetchCache = 'force-no-store'
10+
811
export default async function SandboxInspectPage({
912
params,
1013
}: {

src/features/dashboard/sandboxes/table-row.tsx

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,38 +5,33 @@ import { flexRender } from '@tanstack/react-table'
55
import { Sandbox } from '@/types/api'
66
import { useParams, useRouter, useSelectedLayoutSegment } from 'next/navigation'
77
import { PROTECTED_URLS } from '@/configs/urls'
8+
import Link from 'next/link'
89

910
interface TableRowProps {
1011
row: Row<Sandbox>
1112
}
1213

1314
export const TableRow = memo(function TableRow({ row }: TableRowProps) {
14-
const router = useRouter()
1515
const { teamIdOrSlug } = useParams()
16+
const sandboxId = `${row.original.sandboxID}-${row.original.clientID}`
1617

1718
if (!teamIdOrSlug || typeof teamIdOrSlug !== 'string') {
1819
return null
1920
}
2021

2122
return (
22-
<DataTableRow
23-
key={row.id}
24-
onClick={() => {
25-
router.push(
26-
PROTECTED_URLS.SANDBOX_INSPECT(
27-
teamIdOrSlug,
28-
`${row.original.sandboxID}-${row.original.clientID}`
29-
)
30-
)
31-
}}
32-
className="cursor-pointer"
33-
isSelected={row.getIsSelected()}
34-
>
35-
{row.getVisibleCells().map((cell) => (
36-
<DataTableCell key={cell.id} cell={cell}>
37-
{flexRender(cell.column.columnDef.cell, cell.getContext())}
38-
</DataTableCell>
39-
))}
40-
</DataTableRow>
23+
<Link href={PROTECTED_URLS.SANDBOX_INSPECT(teamIdOrSlug, sandboxId)}>
24+
<DataTableRow
25+
key={row.id}
26+
className="hover:bg-bg-100 cursor-pointer"
27+
isSelected={row.getIsSelected()}
28+
>
29+
{row.getVisibleCells().map((cell) => (
30+
<DataTableCell key={cell.id} cell={cell}>
31+
{flexRender(cell.column.columnDef.cell, cell.getContext())}
32+
</DataTableCell>
33+
))}
34+
</DataTableRow>
35+
</Link>
4136
)
4237
})

0 commit comments

Comments
 (0)