Spaces:
Paused
Paused
Download frontend/packages/shared/src/components/Input.tsx from 3SCError404/nexus: direct link, hf CLI and curl.
- Browser
- Download file 674 Bytes
-
https://huggingface.co/spaces/3SCError404/nexus/resolve/main/frontend/packages/shared/src/components/Input.tsx
- Command line
-
hf download hf://spaces/3SCError404/nexus/frontend/packages/shared/src/components/Input.tsx
-
curl -L -o Input.tsx https://huggingface.co/spaces/3SCError404/nexus/resolve/main/frontend/packages/shared/src/components/Input.tsx
674 Bytes
| import React from 'react'; | |
| import styles from './Input.module.css'; | |
| interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> { | |
| label?: string; | |
| error?: string; | |
| className?: string; | |
| } | |
| export const Input: React.FC<InputProps> = ({ | |
| label, | |
| error, | |
| className, | |
| id, | |
| ...props | |
| }) => { | |
| return ( | |
| <div className={`${styles.container} ${className || ''}`}> | |
| {label && <label htmlFor={id} className={styles.label}>{label}</label>} | |
| <input | |
| id={id} | |
| className={`${styles.input} ${error ? styles.inputError : ''}`} | |
| {...props} | |
| /> | |
| {error && <span className={styles.errorText}>{error}</span>} | |
| </div> | |
| ); | |
| }; | |