diff --git a/src/components/features/ToolCard.tsx b/src/components/features/ToolCard.tsx index ae3aac82..c387c5ad 100644 --- a/src/components/features/ToolCard.tsx +++ b/src/components/features/ToolCard.tsx @@ -1,5 +1,6 @@ import { motion } from 'framer-motion'; -import { Terminal } from 'lucide-react'; +import { Terminal, Clipboard } from 'lucide-react'; +import { useState } from 'react'; interface ToolCardProps { name: string; @@ -9,6 +10,17 @@ interface ToolCardProps { } export function ToolCard({ name, description, category, command }: ToolCardProps) { + const [copied, setCopied] = useState(false); + + const handleCopyClick = () => { + navigator.clipboard.writeText(command) + .then(() => { + setCopied(true); + setTimeout(() => setCopied(false), 2000); // Reset copied status after 2 seconds + }) + .catch((error) => console.error('Failed to copy: ', error)); + }; + return ( {category} - {command} +
+ {command} + +
);