security/codeql-dependabot-gitleaks
| 1 | import { Input } from "@medusajs/ui" |
| 2 | import { useState } from "react" |
| 3 | |
| 4 | export default function InputControlled() { |
| 5 | const [value, setValue] = useState("") |
| 6 | |
| 7 | return ( |
| 8 | <div className="flex flex-col items-center gap-2"> |
| 9 | <Input |
| 10 | value={value} |
| 11 | onChange={(e) => setValue(e.target.value)} |
| 12 | placeholder="Enter name" |
| 13 | id="controlled-input" |
| 14 | /> |
| 15 | {value && <span>Hello, {value}!</span>} |
| 16 | </div> |
| 17 | ) |
| 18 | } |