--- interface Props { title: string; subtitle?: string; badgeText?: string; highlightText?: string; highlightInTitle?: boolean; // Если true, то highlightText будет частью заголовка, иначе - частью subtitle centered?: boolean; titleColor?: 'white' | 'gray-900'; // Цвет заголовка, по умолчанию 'white' для темных фонов и 'gray-900' для светлых subtitleColor?: 'gray-400' | 'gray-600'; // Цвет подзаголовка highlightInSubtitle?: boolean; // Если true, то highlightText будет частью подзаголовка с особым оформлением contactsFormat?: boolean; // Если true, то используется специальный формат для контактов с выделением в подзаголовке titleSize?: 'normal' | 'large'; // Размер заголовка: normal (text-4xl md:text-5xl) или large (text-3xl sm:text-4xl md:text-6xl lg:text-8xl) } const { title, subtitle, badgeText = "Мнение клиентов", highlightText, highlightInTitle = true, // по умолчанию highlightText будет частью заголовка centered = true, titleColor = 'white', subtitleColor = 'gray-400', highlightInSubtitle = false, contactsFormat = false, titleSize = 'large' } = Astro.props; // Определение классов цветов const titleTextColor = titleColor === 'white' ? '[var(--color-white)]' : 'gray-900'; const subtitleTextColor = subtitleColor === 'gray-400' ? '[var(--color-gray-400)]' : 'gray-600'; ---
{subtitle} {contactsFormat && !highlightInTitle && highlightText ? ( {highlightText} ) : (!highlightInTitle && highlightText && highlightInSubtitle) ? ( {highlightText} ) : (!highlightInTitle && highlightText && !highlightInSubtitle) ? ( {highlightText} ) : null}
)}