<commit_before>import { css } from '@emotion/css';
import React from 'react';

import { GrafanaTheme2 } from '@grafana/data';
import { selectors } from '@grafana/e2e-selectors';
import { getDataSourceSrv } from '@grafana/runtime';
import { InlineField, InlineSwitch, Input, Badge, useStyles2 } from '@grafana/ui';

export interface Props {
  dataSourceName: string;
  isDefault: boolean;
  onNameChange: (name: string) => void;
  onDefaultChange: (value: boolean) => void;
}

export function BasicSettings({ dataSourceName, isDefault, onDefaultChange, onNameChange }: Props) {
  const ds = getDataSourceSrv()?.getInstanceSettings(dataSourceName);
  const hasAlertingEnabled = Boolean(ds?.meta?.alerting ?? false);

  return (
    <>
      <AlertingEnabled enabled={hasAlertingEnabled} />
      <div className="gf-form-group" aria-label="Datasource settings page basic settings"><commit_msg>Alerting: Show alerting enabled for Alertmanager data sources (#54023)<commit_after>import { css } from '@emotion/css';
import React from 'react';

import { GrafanaTheme2 } from '@grafana/data';
import { selectors } from '@grafana/e2e-selectors';
import { getDataSourceSrv } from '@grafana/runtime';
import { InlineField, InlineSwitch, Input, Badge, useStyles2 } from '@grafana/ui';

export interface Props {
  dataSourceName: string;
  isDefault: boolean;
  onNameChange: (name: string) => void;
  onDefaultChange: (value: boolean) => void;
}

export function BasicSettings({ dataSourceName, isDefault, onDefaultChange, onNameChange }: Props) {
  const ds = getDataSourceSrv()?.getInstanceSettings(dataSourceName);
  const hasAlertingEnabled = Boolean(ds?.meta?.alerting ?? false);
  const isAlertManagerDatasource = ds?.type === 'alertmanager';

  return (
    <>
      {<AlertingEnabled enabled={hasAlertingEnabled || isAlertManagerDatasource} />}
      <div className="gf-form-group" aria-label="Datasource settings page basic settings">
{'fraction_non_alphanumeric': 0.1258415328845158, 'fraction_numerical': 0.005696530295183843, 'mean_word_length': 5.616438356164384, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '13404', 'n_tokens_mistral': 587, 'n_tokens_neox': 578, 'n_words': 148}