style: format collection page
This commit is contained in:
parent
3d021e079f
commit
1c3855fa4f
1 changed files with 27 additions and 15 deletions
|
|
@ -127,9 +127,12 @@ export default function CollectionDetailPage(): React.ReactElement {
|
||||||
newParams.set('tab', newTab);
|
newParams.set('tab', newTab);
|
||||||
}
|
}
|
||||||
const queryString = newParams.toString();
|
const queryString = newParams.toString();
|
||||||
router.replace(`/dashboard/collections/${collectionId}${queryString ? `?${queryString}` : ''}`, {
|
router.replace(
|
||||||
scroll: false,
|
`/dashboard/collections/${collectionId}${queryString ? `?${queryString}` : ''}`,
|
||||||
});
|
{
|
||||||
|
scroll: false,
|
||||||
|
}
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
const fetchCollection = useCallback(async () => {
|
const fetchCollection = useCallback(async () => {
|
||||||
|
|
@ -385,7 +388,11 @@ export default function CollectionDetailPage(): React.ReactElement {
|
||||||
const tabs = [
|
const tabs = [
|
||||||
{ id: 'tools' as const, label: 'Tools', count: collection.toolCount },
|
{ id: 'tools' as const, label: 'Tools', count: collection.toolCount },
|
||||||
{ id: 'connect' as const, label: 'Connect' },
|
{ id: 'connect' as const, label: 'Connect' },
|
||||||
{ id: 'env-vars' as const, label: 'Env Vars', count: envVarsCount > 0 ? envVarsCount : undefined },
|
{
|
||||||
|
id: 'env-vars' as const,
|
||||||
|
label: 'Env Vars',
|
||||||
|
count: envVarsCount > 0 ? envVarsCount : undefined,
|
||||||
|
},
|
||||||
{ id: 'settings' as const, label: 'Settings' },
|
{ id: 'settings' as const, label: 'Settings' },
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
@ -416,16 +423,13 @@ export default function CollectionDetailPage(): React.ReactElement {
|
||||||
<Badge variant={collection.isPublic ? 'success' : 'secondary'}>
|
<Badge variant={collection.isPublic ? 'success' : 'secondary'}>
|
||||||
{collection.isPublic ? 'Public' : 'Private'}
|
{collection.isPublic ? 'Public' : 'Private'}
|
||||||
</Badge>
|
</Badge>
|
||||||
{executorConfig?.type === 'custom_url' && <Badge variant="secondary">Custom Executor</Badge>}
|
{executorConfig?.type === 'custom_url' && (
|
||||||
|
<Badge variant="secondary">Custom Executor</Badge>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Tabs */}
|
{/* Tabs */}
|
||||||
<Tabs
|
<Tabs tabs={tabs} activeTab={activeTab} onTabChange={handleTabChange} className="mb-6" />
|
||||||
tabs={tabs}
|
|
||||||
activeTab={activeTab}
|
|
||||||
onTabChange={handleTabChange}
|
|
||||||
className="mb-6"
|
|
||||||
/>
|
|
||||||
|
|
||||||
{/* Tools Tab */}
|
{/* Tools Tab */}
|
||||||
{activeTab === 'tools' && (
|
{activeTab === 'tools' && (
|
||||||
|
|
@ -449,7 +453,9 @@ export default function CollectionDetailPage(): React.ReactElement {
|
||||||
<TableHead className="w-[250px]">Tool</TableHead>
|
<TableHead className="w-[250px]">Tool</TableHead>
|
||||||
<TableHead>Description</TableHead>
|
<TableHead>Description</TableHead>
|
||||||
<TableHead className="w-[120px]">Category</TableHead>
|
<TableHead className="w-[120px]">Category</TableHead>
|
||||||
{collection.isOwner && <TableHead className="w-[80px] text-right">Actions</TableHead>}
|
{collection.isOwner && (
|
||||||
|
<TableHead className="w-[80px] text-right">Actions</TableHead>
|
||||||
|
)}
|
||||||
</TableRow>
|
</TableRow>
|
||||||
</TableHeader>
|
</TableHeader>
|
||||||
<TableBody>
|
<TableBody>
|
||||||
|
|
@ -523,7 +529,8 @@ export default function CollectionDetailPage(): React.ReactElement {
|
||||||
<div>
|
<div>
|
||||||
<h3 className="font-medium text-foreground">Set your username to enable MCP</h3>
|
<h3 className="font-medium text-foreground">Set your username to enable MCP</h3>
|
||||||
<p className="text-sm text-foreground-secondary mt-1">
|
<p className="text-sm text-foreground-secondary mt-1">
|
||||||
You need to set a username before you can share this collection as an MCP server.
|
You need to set a username before you can share this collection as an MCP
|
||||||
|
server.
|
||||||
</p>
|
</p>
|
||||||
<Link href="/dashboard/settings/profile" className="inline-block mt-3">
|
<Link href="/dashboard/settings/profile" className="inline-block mt-3">
|
||||||
<Button size="sm" variant="secondary">
|
<Button size="sm" variant="secondary">
|
||||||
|
|
@ -599,7 +606,10 @@ export default function CollectionDetailPage(): React.ReactElement {
|
||||||
Claude Desktop, Cursor, or any MCP client
|
Claude Desktop, Cursor, or any MCP client
|
||||||
</Link>
|
</Link>
|
||||||
. Requires your{' '}
|
. Requires your{' '}
|
||||||
<Link href="/dashboard/settings/tpmjs-api-keys" className="text-primary hover:underline">
|
<Link
|
||||||
|
href="/dashboard/settings/tpmjs-api-keys"
|
||||||
|
className="text-primary hover:underline"
|
||||||
|
>
|
||||||
TPMJS API key
|
TPMJS API key
|
||||||
</Link>{' '}
|
</Link>{' '}
|
||||||
for authentication.
|
for authentication.
|
||||||
|
|
@ -634,7 +644,9 @@ export default function CollectionDetailPage(): React.ReactElement {
|
||||||
{activeTab === 'env-vars' && !collection.isOwner && (
|
{activeTab === 'env-vars' && !collection.isOwner && (
|
||||||
<div className="text-center py-16">
|
<div className="text-center py-16">
|
||||||
<Icon icon="key" size="lg" className="mx-auto text-foreground-tertiary mb-4" />
|
<Icon icon="key" size="lg" className="mx-auto text-foreground-tertiary mb-4" />
|
||||||
<h2 className="text-lg font-medium text-foreground mb-2">Environment Variables Unavailable</h2>
|
<h2 className="text-lg font-medium text-foreground mb-2">
|
||||||
|
Environment Variables Unavailable
|
||||||
|
</h2>
|
||||||
<p className="text-foreground-secondary">
|
<p className="text-foreground-secondary">
|
||||||
You can only view environment variables for collections you own.
|
You can only view environment variables for collections you own.
|
||||||
</p>
|
</p>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue