diff options
| author | Bobby <[email protected]> | 2022-11-30 23:16:07 -0500 |
|---|---|---|
| committer | Bobby <[email protected]> | 2022-11-30 23:16:07 -0500 |
| commit | daaa789068cebb5fdfcea6197ade6e663be46e0f (patch) | |
| tree | 1cd315851b779ac28fe622da332c3c16fe1c433c /src/components/configuration/inputWrapper.tsx | |
| download | tcssocialify-daaa789068cebb5fdfcea6197ade6e663be46e0f.tar.xz tcssocialify-daaa789068cebb5fdfcea6197ade6e663be46e0f.zip | |
socialify update
Diffstat (limited to 'src/components/configuration/inputWrapper.tsx')
| -rw-r--r-- | src/components/configuration/inputWrapper.tsx | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/src/components/configuration/inputWrapper.tsx b/src/components/configuration/inputWrapper.tsx new file mode 100644 index 0000000..0d3fd95 --- /dev/null +++ b/src/components/configuration/inputWrapper.tsx @@ -0,0 +1,41 @@ +import ConfigType from '../../../common/types/configType' + +type InputProps = { + title: string + alt?: string + keyName: keyof ConfigType + value: string + placeholder: string + disabled?: boolean + handleChange: (value: any, key: keyof ConfigType) => void +} + +const InputWrapper = ({ + title, + alt, + keyName, + value, + placeholder, + disabled, + handleChange +}: InputProps) => { + return ( + <div className="form-control w-full" style={{ display: 'none' }}> + <label className="label"> + <span className="label-text">{title}</span> + {alt && <span className="label-text-alt">{alt}</span>} + </label> + <input + className="input input-bordered w-full input-sm" + type="text" + value={value || ''} + disabled={!!disabled} + placeholder={placeholder} + onChange={(e) => { + handleChange({ val: e.target.value, required: true }, keyName) + }} + /> + </div> + ) +} +export default InputWrapper |
