/
lizardking
/
react_project
Обзор
Документация
Войти
/
lizardking
/
react_project
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
src/shared/ui/Section/Section.tsx
36 строк
1 KB
LizardKing
Task 5 - styles
17 окт 2025, 15:20
17 окт 2025, 15:20
578bb65
Код
Авторство
О чём код?
import React, { memo } from 'react' type SectionProps = { title?: string; actions?: React.ReactNode; className?: string; children: React.ReactNode; }; function SectionComponent({ title, actions, className, children }: SectionProps) { const section = 'rounded-2xl border border-slate-800/80 bg-slate-900/60 shadow-lg ' + 'backdrop-blur supports-[backdrop-filter]:bg-slate-900/55 px-4 py-3 w-full' const actionBlock = actions ? <div className="flex items-center gap-2">{actions}</div> : null return ( <section className={[section, className].filter(Boolean).join(' ')}> {title ? ( <header className="flex items-center justify-between gap-3 pb-2 border-b border-slate-800/70"> <h3 className="text-sm font-semibold tracking-wide text-slate-200"> {title} </h3> {actionBlock} </header> ) : actionBlock} <div className="pt-3">{children}</div> </section> ) } export const Section = memo(SectionComponent) Section.displayName = 'Section'