MCPcopy Create free account
hub / github.com/BetterBahn/betterbahn / URLInput

Function URLInput

components/SearchForm/URLInput.tsx:4–39  ·  view source on GitHub ↗
({
	setUrl,
	url,
}: {
	url: string;
	setUrl: Dispatch<string>;
})

Source from the content-addressed store, hash-verified

2import { HelpSection } from "./HelpSection";
3
4export const URLInput = ({
5 setUrl,
6 url,
7}: {
8 url: string;
9 setUrl: Dispatch<string>;
10}) => {
11 const [showHelp, setShowHelp] = useState(false);
12
13 return (
14 <div className="relative">
15 <div className="flex items-center gap-2 mb-2">
16 <label htmlFor="url" className="text-sm font-medium opacity-80">
17 Deutsche Bahn "Verbindung Teilen Text"
18 </label>
19 <button
20 type="button"
21 onClick={() => setShowHelp(!showHelp)}
22 className="inline-flex items-center justify-center w-5 h-5 text-xs bg-gray-100 text-gray-600 rounded-full hover:bg-gray-200 focus:outline-none focus:ring-2 focus:ring-primary cursor-pointer"
23 aria-label="Hilfe anzeigen"
24 >
25 ?
26 </button>
27 </div>
28 <input
29 id="url"
30 value={url}
31 onChange={(e) => setUrl(e.target.value)}
32 placeholder={`Dein "Teilen"-Text von der Deutschen Bahn`}
33 className="w-full px-3 py-2 resize-vertical border-b-2 border-gray-300 focus:ring-2 focus:ring-primary "
34 />
35
36 {showHelp && <HelpSection />}
37 </div>
38 );
39};

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected