mirror of
https://github.com/grafana/grafana.git
synced 2025-02-13 00:55:47 -06:00
* Alerts/InfoBox: Replaces all uses of InfoBox & FeatureInfoBox with Alert * Fixes some more stuff * fixed border radius
37 lines
1.2 KiB
TypeScript
37 lines
1.2 KiB
TypeScript
import React, { FC } from 'react';
|
|
import { Alert, CollapsableSection } from '@grafana/ui';
|
|
import { NotificationChannelOptions } from './NotificationChannelOptions';
|
|
import { NotificationSettingsProps } from './NotificationChannelForm';
|
|
import { NotificationChannelSecureFields, NotificationChannelType } from '../../../types';
|
|
|
|
interface Props extends NotificationSettingsProps {
|
|
selectedChannel: NotificationChannelType;
|
|
secureFields: NotificationChannelSecureFields;
|
|
resetSecureField: (key: string) => void;
|
|
}
|
|
|
|
export const ChannelSettings: FC<Props> = ({
|
|
control,
|
|
currentFormValues,
|
|
errors,
|
|
selectedChannel,
|
|
secureFields,
|
|
register,
|
|
resetSecureField,
|
|
}) => {
|
|
return (
|
|
<CollapsableSection label={`Optional ${selectedChannel.heading}`} isOpen={false}>
|
|
{selectedChannel.info !== '' && <Alert severity="info" title={selectedChannel.info ?? ''} />}
|
|
<NotificationChannelOptions
|
|
selectedChannelOptions={selectedChannel.options.filter((o) => !o.required)}
|
|
currentFormValues={currentFormValues}
|
|
register={register}
|
|
errors={errors}
|
|
control={control}
|
|
onResetSecureField={resetSecureField}
|
|
secureFields={secureFields}
|
|
/>
|
|
</CollapsableSection>
|
|
);
|
|
};
|