import { __ } from '@wordpress/i18n' import classnames from 'classnames' import React, { useState } from 'react' import { isLicensed, shouldShowUpsell } from '../../utils/screen' import { buildUrl, fetchQueryParam } from '../../utils/urls' import { CommunityIcon, LibraryIcon, SettingsIcon, SnippetsIcon } from './icons/ToolbarIcons' import { UpsellDialog } from './UpsellDialog' import type { ReactNode } from 'react' interface NavLink { name: string url?: string label: string external?: boolean icon?: ReactNode pro?: boolean pageSlug?: string subpage?: string } const UPPER_NAV_LINKS: NavLink[] = [ { name: 'docs', url: 'https://codesnippets.pro/docs', label: __('Docs', 'code-snippets'), external: true }, { name: 'cloud', url: 'https://codesnippets.cloud/', label: __('Cloud Dashboard', 'code-snippets'), external: true }, { name: 'welcome', url: window.CODE_SNIPPETS?.urls.welcome, label: __("What's New", 'code-snippets'), pageSlug: 'code-snippets-welcome' } ] const LOWER_NAV_LINKS: NavLink[] = [ { name: 'snippets', url: window.CODE_SNIPPETS?.urls.manage, label: __('Snippets', 'code-snippets'), icon: