refactor: extract Installation Guides into block renderer components

Replace monolithic Connection.tsx (1076 lines) with modular architecture:
- 4 block renderers (cards, timeline, accordion, minimal) selectable
  via uiConfig.installationGuidesBlockType from RemnaWave config
- Color parser utility with 14 named colors + hex support
- InstallationGuide component handles platform/app selection and
  button rendering (subscriptionLink, copyButton, external)
- Remove classic step-based format (AppButton, AppStep, AppInfo)
- Add appConfig query invalidation on admin UUID change
This commit is contained in:
c0mrade
2026-02-05 20:07:07 +03:00
parent 5111b63f2e
commit 813f6e4449
12 changed files with 765 additions and 979 deletions

View File

@@ -0,0 +1,42 @@
import { getColorGradient } from '@/utils/colorParser';
import { ThemeIcon } from './ThemeIcon';
import type { BlockRendererProps } from './types';
export function CardsBlock({
blocks,
isMobile,
getLocalizedText,
getSvgHtml,
renderBlockButtons,
}: BlockRendererProps) {
return (
<div className="space-y-3">
{blocks.map((block, index) => {
const gradientStyle = getColorGradient(block.svgIconColor || 'cyan');
return (
<div
key={index}
className="rounded-2xl border border-dark-700/50 bg-dark-800/50 p-4 sm:p-5"
>
<div className="flex items-start gap-3 sm:gap-4">
<ThemeIcon
getSvgHtml={getSvgHtml}
svgIconKey={block.svgIconKey}
gradientStyle={gradientStyle}
isMobile={isMobile}
/>
<div className="min-w-0 flex-1">
<h3 className="font-semibold text-dark-100">{getLocalizedText(block.title)}</h3>
<p className="mt-1 whitespace-pre-line text-sm leading-relaxed text-dark-400">
{getLocalizedText(block.description)}
</p>
{renderBlockButtons(block.buttons, 'light')}
</div>
</div>
</div>
);
})}
</div>
);
}