// @flow import React from 'react'; import { i18n, components, data } from '../../wp'; import './GeneralSettings.css'; const { __ } = i18n; const { PanelBody, ToggleControl, TextControl } = components; const { select } = data; type GeneralSettingsProps = { isSingle: boolean; title: string; isEnabled: boolean; onChangeTitle: (title: string) => void; onChangeEnabled: (enabled: boolean) => void; }; function GeneralSettings({ isSingle, title, isEnabled, onChangeTitle, onChangeEnabled, }: GeneralSettingsProps) { const { getCurrentPostId } = select('core/editor'); const postId = getCurrentPostId(); return ( {!isSingle && ( )} {isSingle && postId && (
Shortcode: {`[ab-test id=${postId}]`}
)}
); } export default GeneralSettings;