add api frontend

This commit is contained in:
CanbiZ
2025-03-12 13:49:51 +01:00
parent 4b646a40ee
commit 3e9b3e6fe9
4 changed files with 394 additions and 12 deletions

View File

@@ -37,6 +37,10 @@ export default function CodeCopyButton({
);
}, 500);
}
// toast.success(`copied ${type} to clipboard`, {
// icon: <ClipboardCheck className="h-4 w-4" />,
// });
};
return (
@@ -45,17 +49,17 @@ export default function CodeCopyButton({
<div className="overflow-x-auto whitespace-pre-wrap text-nowrap break-all pr-4 text-sm">
{!isMobile && children ? children : "Copy install command"}
</div>
<button
<div
className={cn(" right-0 cursor-pointer bg-muted px-3 py-4")}
onClick={() => handleCopy("install command", children)}
className={cn("bg-muted px-3 py-4")}
title="Copy"
>
{hasCopied ? (
<CheckIcon className="h-4 w-4" />
) : (
<ClipboardIcon className="h-4 w-4" />
)}
</button>
<span className="sr-only">Copy</span>
</div>
</Card>
</div>
);