{"size": 585, "ext": "js", "max_stars_repo_path": "src/components/localization/language-switch.js", "max_stars_repo_name": "educandu/educandu", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/components/localization/language-switch.js", "max_issues_repo_name": "educandu/educandu", "max_issues_repo_issues_event_min_datetime": "2021-11-09T08:34:45.000Z", "max_issues_repo_issues_event_max_datetime": "2022-03-31T14:55:54.000Z", "max_forks_repo_path": "src/components/localization/language-switch.js", "max_forks_repo_name": "educandu/educandu", "max_forks_repo_forks_event_min_datetime": "2021-11-03T10:14:42.000Z", "max_forks_repo_forks_event_max_datetime": "2021-11-03T10:14:42.000Z"}
{"max_stars_count": null, "max_issues_count": 266, "max_forks_count": 1, "avg_line_length": 24.375, "max_line_length": 68, "alphanum_fraction": 0.6188034188}
import React from 'react';
import { Button } from 'antd';
import { useTranslation } from 'react-i18next';

function LanguageSwitch() {
  const { i18n } = useTranslation();

  return (
    <div className="LanguageSwitch">
      <Button type="link" onClick={() => i18n.changeLanguage('de')}>
        <span className="flag-icon flag-icon-de" />
      </Button>
      /
      <Button type="link" onClick={() => i18n.changeLanguage('en')}>
        <span className="flag-icon flag-icon-us" />
      </Button>
    </div>
  );
}

LanguageSwitch.propTypes = {};

export default LanguageSwitch;
