mirror of
https://github.com/chillpadclub/bedolaga-cabinet.git
synced 2026-07-29 18:13:47 +00:00
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:
42
src/components/connection/blocks/CardsBlock.tsx
Normal file
42
src/components/connection/blocks/CardsBlock.tsx
Normal 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>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user