Files
bedolaga-cabinet/src/components/connection/blocks/CardsBlock.tsx
c0mrade 88d9377adb fix: add light theme support to connection page
Add isLight-aware styling to all block renderers (cards, timeline,
accordion, minimal), BlockButtons, and InstallationGuide. Update
colorParser gradient functions to generate light-appropriate backgrounds.
Reduce wave blob opacity on light theme for better content readability.
2026-02-06 18:30:19 +03:00

48 lines
1.4 KiB
TypeScript

import { getColorGradient } from '@/utils/colorParser';
import { ThemeIcon } from './ThemeIcon';
import type { BlockRendererProps } from './types';
export function CardsBlock({
blocks,
isMobile,
isLight,
getLocalizedText,
getSvgHtml,
renderBlockButtons,
}: BlockRendererProps) {
return (
<div className="space-y-3">
{blocks.map((block, index) => {
const gradientStyle = getColorGradient(block.svgIconColor || 'cyan', isLight);
return (
<div
key={index}
className={`rounded-2xl border p-4 sm:p-5 ${
isLight
? 'border-dark-700/60 bg-white/80 shadow-sm'
: 'border-dark-700/50 bg-dark-800/50'
}`}
>
<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>
);
}