66import {
77 CheckIcon ,
88 CircleSlashIcon ,
9- CopyIcon ,
10- EyeIcon ,
11- EyeOffIcon ,
129 PencilLineIcon ,
1310 RefreshCwIcon ,
1411 TrashIcon ,
@@ -34,7 +31,6 @@ import { Slot } from "../../components/Slot.js";
3431import { Button } from "../../ui/Button.js" ;
3532import { Input } from "../../ui/Input.js" ;
3633import { cn } from "../../util/cn.js" ;
37- import { useCopyToClipboard } from "../../util/useCopyToClipboard.js" ;
3834import { CreateApiKeyDialog } from "./CreateApiKeyDialog.js" ;
3935import type { ApiConsumer , ApiKey , ApiKeyService } from "./index.js" ;
4036
@@ -428,7 +424,6 @@ const RevealApiKey = ({
428424 className ?: string ;
429425} ) => {
430426 const [ revealed , setRevealed ] = useState ( false ) ;
431- const [ isCopied , copyToClipboard ] = useCopyToClipboard ( ) ;
432427
433428 const { key, createdOn, expiresOn } = apiKey ;
434429 const isExpired = expiresOn && new Date ( expiresOn ) < new Date ( ) ;
@@ -442,27 +437,13 @@ const RevealApiKey = ({
442437 return (
443438 < div className = { cn ( "grid col-span-full grid-cols-subgrid p-6" , className ) } >
444439 < div className = "flex flex-col gap-1" >
445- < div className = "flex gap-2 items-center text-sm border rounded-md w-full max-w-fit px-1" >
446- < Secret
447- className = "max-w-fit w-full"
448- secret = { key }
449- status = { isExpired ? "expired" : expiresSoon ? "expiring" : "active" }
450- />
451- < Button
452- variant = "ghost"
453- onClick = { ( ) => setRevealed ( ( prev ) => ! prev ) }
454- size = "icon"
455- >
456- { revealed ? < EyeOffIcon size = { 16 } /> : < EyeIcon size = { 16 } /> }
457- </ Button >
458- < Button
459- variant = "ghost"
460- onClick = { ( ) => copyToClipboard ( key ) }
461- size = "icon"
462- >
463- { isCopied ? < CheckIcon size = { 16 } /> : < CopyIcon size = { 16 } /> }
464- </ Button >
465- </ div >
440+ < Secret
441+ className = "max-w-fit w-full"
442+ secret = { key }
443+ status = { isExpired ? "expired" : expiresSoon ? "expiring" : "active" }
444+ revealed = { revealed }
445+ onReveal = { setRevealed }
446+ />
466447 < div className = "flex gap-1 mt-0.5 text-nowrap" >
467448 { createdOn && (
468449 < span className = "text-xs text-muted-foreground" >
0 commit comments