import { __, sprintf } from '@wordpress/i18n' import classnames from 'classnames' import React from 'react' import type { InsightsChartView } from '../../types/Insights' interface ViewToggleButtonProps extends InsightsChartViewToggleProps { icon: string label: string currentView: View } const ViewToggleButton = ( { icon, title, label, view, setView, currentView }: ViewToggleButtonProps ) => export interface InsightsChartViewToggleProps { title: string view: View setView: (view: View) => void views: readonly View[] } const VIEW_OPTIONS: Readonly> = { pie: { icon: 'chart-pie', label: __('Chart view', 'code-snippets'), title: __('Switch to chart view', 'code-snippets') }, bar: { icon: 'chart-bar', label: __('List view', 'code-snippets'), title: __('Switch to list view', 'code-snippets') }, cloud: { icon: 'cloud', label: __('Tags cloud view', 'code-snippets'), title: __('Switch to tags cloud view', 'code-snippets') } } export const InsightsChartViewToggle = ( { title, view, setView, views }: InsightsChartViewToggleProps ) =>
{views.map(option => )}