Files
standardnotes-app-web/app/assets/javascripts/Components/Input/Input.tsx
2022-04-13 22:02:34 +05:30

15 lines
520 B
TypeScript

import { FunctionalComponent } from 'preact'
interface Props {
text?: string
disabled?: boolean
className?: string
}
export const Input: FunctionalComponent<Props> = ({ className = '', disabled = false, text }) => {
const base = 'rounded py-1.5 px-3 text-input my-1 h-8 bg-contrast'
const stateClasses = disabled ? 'no-border' : 'border-solid border-1 border-main'
const classes = `${base} ${stateClasses} ${className}`
return <input type="text" className={classes} disabled={disabled} value={text} />
}