Skip to content

Commit

Permalink
Merge pull request #43 from th3f0r3ign3r/main
Browse files Browse the repository at this point in the history
  • Loading branch information
vantezzen authored Oct 22, 2023
2 parents 5eec76d + 4c9886f commit 1fb87b7
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/components/ui/auto-form/fields/textarea.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,18 @@ export default function AutoFormTextarea({
fieldConfigItem,
fieldProps,
}: AutoFormInputComponentProps) {
const { showLabel: _showLabel, ...fieldPropsWithoutShowLabel } = fieldProps;
const showLabel = _showLabel === undefined ? true : _showLabel;
return (
<FormItem>
<FormLabel>
{label}
{isRequired && <span className="text-destructive"> *</span>}
</FormLabel>
{showLabel && (
<FormLabel>
{label}
{isRequired && <span className="text-destructive"> *</span>}
</FormLabel>
)}
<FormControl>
<Textarea {...fieldProps} />
<Textarea {...fieldPropsWithoutShowLabel} />
</FormControl>
{fieldConfigItem.description && (
<FormDescription>{fieldConfigItem.description}</FormDescription>
Expand Down

0 comments on commit 1fb87b7

Please sign in to comment.