@awsui/components-react
Version:
On July 19th, 2022, we launched [Cloudscape Design System](https://cloudscape.design). Cloudscape is an evolution of AWS-UI. It consists of user interface guidelines, front-end components, design resources, and development tools for building intuitive, en
14 lines • 1.11 kB
JavaScript
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
import React from 'react';
import { useInternalI18n } from '../i18n/context';
import InternalSegmentedControl from '../segmented-control/internal';
import testutilStyles from './test-classes/styles.css.js';
export default function ModeSwitcher({ i18nStrings, mode, onChange }) {
const i18n = useInternalI18n('date-range-picker');
return (React.createElement(InternalSegmentedControl, { className: testutilStyles['mode-switch'], selectedId: mode, label: i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.modeSelectionLabel, options: [
{ id: 'relative', text: i18n('i18nStrings.relativeModeTitle', i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.relativeModeTitle) },
{ id: 'absolute', text: i18n('i18nStrings.absoluteModeTitle', i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.absoluteModeTitle) },
], onChange: e => onChange(e.detail.selectedId) }));
}
//# sourceMappingURL=mode-switcher.js.map