MCPcopy Create free account
hub / github.com/DavidHDev/react-bits / QuickStart

Function QuickStart

src/components/landingnew/QuickStart/QuickStart.jsx:18–117  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

16};
17
18const QuickStart = () => {
19 const { cliTool, setCliTool, packageManager, setPackageManager } = useInstallation();
20 const [copied, setCopied] = useState(false);
21 const [dropOpen, setDropOpen] = useState(false);
22 const timerRef = useRef(null);
23
24 const runner = PKG_TO_RUNNER[packageManager] ?? 'npx';
25 const command = COMMANDS[cliTool]?.(runner) ?? COMMANDS.shadcn(runner);
26
27 const copy = useCallback(() => {
28 navigator.clipboard.writeText(command);
29 setCopied(true);
30 clearTimeout(timerRef.current);
31 timerRef.current = setTimeout(() => setCopied(false), 2000);
32 }, [command]);
33
34 return (
35 <section className="ln-qs-section">
36 <div className="ln-qs-inner">
37 <motion.div
38 className="ln-qs-header"
39 initial={{ opacity: 0, y: 24 }}
40 whileInView={{ opacity: 1, y: 0 }}
41 viewport={{ once: true, margin: '-60px' }}
42 transition={{ duration: 0.5, ease: [0.21, 0.47, 0.32, 0.98] }}
43 >
44 <h2 className="ln-qs-title">Get started in seconds</h2>
45 </motion.div>
46
47 <motion.div
48 className="ln-qs-terminal-wrap"
49 initial={{ opacity: 0, y: 24 }}
50 whileInView={{ opacity: 1, y: 0 }}
51 viewport={{ once: true, margin: '-60px' }}
52 transition={{ duration: 0.5, delay: 0.07, ease: [0.21, 0.47, 0.32, 0.98] }}
53 >
54 <div className="ln-qs-glow" />
55 <div className="ln-qs-terminal">
56 {/* tab bar with tool selector + runner dropdown */}
57 <div className="ln-qs-tab-bar">
58 <div className="ln-qs-tabs">
59 {TOOLS.map((t) => (
60 <button
61 key={t}
62 className={`ln-qs-tab${cliTool === t ? ' ln-qs-tab--active' : ''}`}
63 onClick={() => setCliTool(t)}
64 >
65 {t}
66 </button>
67 ))}
68 </div>
69
70 <div className="ln-qs-tab-bar-right">
71 <div className="ln-qs-runner-dropdown">
72 <button
73 className="ln-qs-runner-trigger"
74 onClick={() => setDropOpen((v) => !v)}
75 >

Callers

nothing calls this directly

Calls 1

useInstallationFunction · 0.90

Tested by

no test coverage detected