mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Grafana-UI: Fix use of Fragments as children of InlineField (#46326)
This commit is contained in:
@@ -3,6 +3,7 @@ import { Input } from '../Input/Input';
|
||||
import { Button } from '../Button';
|
||||
import { TextArea } from '../TextArea/TextArea';
|
||||
import { InlineField } from '../Forms/InlineField';
|
||||
import { InlineFieldRow } from '../Forms/InlineFieldRow';
|
||||
|
||||
interface Props {
|
||||
label: string;
|
||||
@@ -15,17 +16,19 @@ interface Props {
|
||||
|
||||
export const CertificationKey: FC<Props> = ({ hasCert, label, onChange, onClick, placeholder }) => {
|
||||
return (
|
||||
<InlineField label={label} labelWidth={14}>
|
||||
{hasCert ? (
|
||||
<>
|
||||
<Input type="text" disabled value="configured" width={24} />
|
||||
<Button variant="secondary" onClick={onClick} style={{ marginLeft: 4 }}>
|
||||
Reset
|
||||
</Button>
|
||||
</>
|
||||
) : (
|
||||
<TextArea rows={7} onChange={onChange} placeholder={placeholder} required />
|
||||
<InlineFieldRow>
|
||||
<InlineField label={label} labelWidth={14} disabled={hasCert}>
|
||||
{hasCert ? (
|
||||
<Input type="text" value="configured" width={24} />
|
||||
) : (
|
||||
<TextArea rows={7} onChange={onChange} placeholder={placeholder} required />
|
||||
)}
|
||||
</InlineField>
|
||||
{hasCert && (
|
||||
<Button variant="secondary" onClick={onClick} style={{ marginLeft: 4 }}>
|
||||
Reset
|
||||
</Button>
|
||||
)}
|
||||
</InlineField>
|
||||
</InlineFieldRow>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user