BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/smithery/smithery-tokens

Smithery Tokens

smithery/smithery-tokens
FreeBlock

A component for managing Smithery API tokens with selection and creation capabilities.

Install it

npx shadcn@latest add https://smithery.chat/r/smithery-tokens.json

Source

registry/new-york/smithery/tokens.tsxsmithery.chat/r/smithery-tokens.json · first 6 KB
1"use client";
2
3import { useAtom } from "jotai";
4import { Loader2, Plus, Trash2 } from "lucide-react";
5import { useState } from "react";
6import {
7 CodeBlock,
8 CodeBlockCopyButton,
9} from "@/components/ai-elements/code-block";
10import { Button } from "@/components/ui/button";
11import {
12 Dialog,
13 DialogContent,
14 DialogHeader,
15 DialogTitle,
16 DialogTrigger,
17} from "@/components/ui/dialog";
18import { Input } from "@/components/ui/input";
19import {
20 Select,
21 SelectContent,
22 SelectItem,
23 SelectTrigger,
24 SelectValue,
25} from "@/components/ui/select";
26import { selectedTokenAtom, tokensCreatedAtom } from "@/hooks/use-smithery";
27import { useSmitheryContext } from "@/registry/new-york/smithery/smithery-provider";
28
29function formatTimeRemaining(expiresAt: string): string {
30 if (!expiresAt || expiresAt === "never") return "1 hour";
31 const expiresDate = new Date(expiresAt);
32 const now = new Date();
33 const diffMs = expiresDate.getTime() - now.getTime();
34 if (diffMs <= 0) return "expired";
35 const diffMins = Math.floor(diffMs / 60000);
36 if (diffMins < 60) {
37 return `${diffMins} minute${diffMins !== 1 ? "s" : ""}`;
38 }
39 const diffHours = Math.floor(diffMins / 60);
40 return `${diffHours} hour${diffHours !== 1 ? "s" : ""}`;
41}
42
43export function Tokens() {
44 const [tokensCreated, setTokensCreated] = useAtom(tokensCreatedAtom);
45 const [selectedToken, setSelectedToken] = useAtom(selectedTokenAtom);
46 const [isOpen, setIsOpen] = useState(false);
47 const [isCreatingToken, setIsCreatingToken] = useState(false);
48 const [isCreatingNamespace, setIsCreatingNamespace] = useState(false);
49 const [newNamespaceName, setNewNamespaceName] = useState("");
50 const [showNamespaceInput, setShowNamespaceInput] = useState(false);
51
52 const {
53 createToken,
54 createNamespace,
55 loading,
56 namespace,
57 namespaces,
58 setNamespace,
59 sandboxMode,
60 tokenExpiresAt,
61 } = useSmitheryContext();
62 const [namespaceError, setNamespaceError] = useState<string | null>(null);
63
64 const handleRemoveToken = () => {
65 if (!selectedToken) return;
66
67 setTokensCreated((prev) =>
68 prev.filter((token) => token.token !== selectedToken.token),
69 );
70 setSelectedToken(null);
71 };
72
73 const handleCreateToken = async () => {
74 setIsCreatingToken(true);
75 try {
76 await createToken();
77 } finally {
78 setIsCreatingToken(false);
79 }
80 };
81
82 const handleCreateNamespace = async () => {
83 if (!newNamespaceName.trim()) return;
84 setIsCreatingNamespace(true);
85 setNamespaceError(null);
86 try {
87 await createNamespace(newNamespaceName.trim());
88// … truncated

What it pulls in

npm packages

  • @smithery/api
  • jotai
  • lucide-react

Other registry items

  • button
  • dialog
  • select

Files it writes

  • registry/new-york/smithery/tokens.tsx

Facts

Registry
smithery
Type
registry:block
Access
Free
Files written
1
Licence
the repository states none
First indexed
2026-08-02
Last confirmed
today

Go to the source

smithery.chat smithery-ai/openchat on GitHub Raw registry item This item as JSON

More from smithery

All 10 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
SmitherysmitherysmitheryBlocksFree9 deps · 11 files
Smithery Connection Contextsmithery-connection-contextsmitheryBlocksFreeno deps
Smithery Connectionssmithery-connectionssmitheryBlocksFree8 deps · 9 files
Smithery Schema Formsmithery-schema-formsmitheryBlocksFree1 dep
Smithery Server Searchsmithery-server-searchsmitheryBlocksFree3 deps · 3 files
Smithery Tool Cardsmithery-tool-cardsmitheryBlocksFree5 deps · 4 files
Smithery Tool Detail Dialogsmithery-tool-detail-dialogsmitheryBlocksFree5 deps · 3 files
Smithery Tools Panelsmithery-tools-panelsmitheryBlocksFree5 deps · 5 files
BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex