Skip to content

Commit

Permalink
remove command
Browse files Browse the repository at this point in the history
  • Loading branch information
ntotten committed Feb 7, 2025
1 parent d607d95 commit e877cd2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 44 deletions.
11 changes: 0 additions & 11 deletions middleware.ts

This file was deleted.

35 changes: 2 additions & 33 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import { Button } from "@/components/ui/button";
import { Braces, Check, Copy, Terminal } from "lucide-react";
import { Braces, Check, Copy } from "lucide-react";
import { useCallback, useState } from "react";

import "./App.css";

export default function UUIDGenerator() {
const [uuid, setUuid] = useState(crypto.randomUUID());
const [copied, setCopied] = useState(false);
const [shellCopied, setShellCopied] = useState(false);

const generateNewUuid = useCallback(() => {
setUuid(crypto.randomUUID());
Expand All @@ -21,14 +20,6 @@ export default function UUIDGenerator() {
});
}, [uuid]);

const cmd = 'curl -s -w "\\n" https://uuid.new';
const copyShellCommand = useCallback(() => {
navigator.clipboard.writeText(cmd).then(() => {
setShellCopied(true);
setTimeout(() => setShellCopied(false), 2000);
});
}, []);

return (
<div className="min-h-screen flex flex-col items-center justify-center bg-gray-900 text-white">
<div className="fixed top-0 left-0 right-0 z-50 bg-gray-900/50 backdrop-blur-sm px-4 py-2">
Expand Down Expand Up @@ -60,33 +51,11 @@ export default function UUIDGenerator() {
</div>
<Button
onClick={generateNewUuid}
className="w-full bg-gradient-to-r from-pink-500 to-purple-600 hover:from-pink-600 hover:to-purple-700 text-white mb-6"
className="w-full bg-gradient-to-r from-pink-500 to-purple-600 hover:from-pink-600 hover:to-purple-700 text-white"
size="lg"
>
Generate New UUID
</Button>
<div className="bg-gray-800 rounded-lg p-4">
<div className="flex items-center justify-between mb-2">
<div className="flex items-center">
<Terminal className="h-4 w-4 mr-2 text-pink-500" />
<span className="text-sm font-semibold">Curl Command</span>
</div>
<Button
variant="ghost"
size="icon"
className="h-8 w-8 text-gray-400 hover:text-pink-500"
onClick={copyShellCommand}
>
{shellCopied ? (
<Check className="h-4 w-4" />
) : (
<Copy className="h-4 w-4" />
)}
<span className="sr-only">Copy Command</span>
</Button>
</div>
<code className="font-mono text-sm text-gray-300">{cmd}</code>
</div>
</div>
</div>
);
Expand Down

0 comments on commit e877cd2

Please sign in to comment.