Skip to content

Commit

Permalink
Added JSDoc for Input UI Component
Browse files Browse the repository at this point in the history
  • Loading branch information
miksrv committed Oct 2, 2024
1 parent c0c4e6c commit 58c9580
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/clean-peaches-happen.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@miksoft/simple-uikit': patch
---

Added JSDoc for Input UI Component
17 changes: 16 additions & 1 deletion src/input/Input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,27 @@ import styles from './styles.module.sass'

import { concatClassNames as cn } from '@/tools'

/**
* Props for the Input component.
*
* @interface InputProps
* @extends {React.InputHTMLAttributes<HTMLInputElement>}
* @property {string} [label] - The label for the input field.
* @property {string} [error] - Error message to display below the input.
*/
interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> {
label?: string
error?: string
}

const Input: React.FC<InputProps> = ({ label, error, ...props }) => (
/**
* A functional component that renders an input field with an optional label and error message.
* @param label
* @param error
* @param props
* @returns {JSX.Element} The rendered input component.
*/
const Input: React.FC<InputProps> = ({ label, error, ...props }: InputProps): JSX.Element => (
<div
className={cn(
styles.input,
Expand Down

0 comments on commit 58c9580

Please sign in to comment.