-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
131 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import React, { useState } from 'react'; | ||
import { Copy, Check } from 'lucide-react'; | ||
|
||
const BashCommand = () => { | ||
const [copied, setCopied] = useState(false); | ||
const command = "curl -sL brew install nethermindeth/sedge/sedge"; | ||
|
||
const copyToClipboard = async () => { | ||
try { | ||
await navigator.clipboard.writeText(command); | ||
setCopied(true); | ||
setTimeout(() => setCopied(false), 2000); | ||
} catch (err) { | ||
console.error('Failed to copy text: ', err); | ||
} | ||
}; | ||
|
||
return ( | ||
<div className="rounded-md bg-gray-900 text-white font-mono text-sm"> | ||
<div className="flex items-center p-4"> | ||
<div className="flex-grow overflow-x-auto mr-4"> | ||
<pre className="flex items-center"> | ||
<code className="overflow-x-auto">{command}</code> | ||
</pre> | ||
</div> | ||
<div className="flex-shrink-0"> | ||
<button | ||
onClick={copyToClipboard} | ||
className="p-2 rounded hover:bg-gray-700 transition-colors" | ||
aria-label="Copy to clipboard" | ||
> | ||
{copied ? ( | ||
<Check className="h-5 w-5 text-green-400"/> | ||
) : ( | ||
<Copy className="h-5 w-5 text-gray-400"/> | ||
)} | ||
</button> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default BashCommand; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters