ConfirmDialog.js
1 month ago
LabelWithTooltip.js
1 month ago
ProGate.js
1 month ago
SectionCard.js
1 month ago
SettingsDataProvider.js
1 month ago
SettingsPageShell.js
1 month ago
UnsavedChangesDialog.js
1 month ago
navigationGuard.js
1 month ago
SectionCard.js
45 lines
| 1 | import { Text } from '@bsf/force-ui'; |
| 2 | |
| 3 | const TITLE_SIZE_CLASSES = { |
| 4 | xs: '!text-sm', |
| 5 | sm: '!text-base', |
| 6 | md: '!text-lg', |
| 7 | }; |
| 8 | |
| 9 | const SectionCard = ( { |
| 10 | title, |
| 11 | description, |
| 12 | children, |
| 13 | titleAddon, |
| 14 | titleSize = 'sm', |
| 15 | } ) => { |
| 16 | const titleClassName = `${ |
| 17 | TITLE_SIZE_CLASSES[ titleSize ] || TITLE_SIZE_CLASSES.sm |
| 18 | } !font-semibold m-0 p-0 text-text-primary`; |
| 19 | return ( |
| 20 | <div className="bg-white p-6 box-border shadow-sm rounded-xl"> |
| 21 | { ( title || description ) && ( |
| 22 | <div className="mb-4"> |
| 23 | { title && |
| 24 | ( titleAddon ? ( |
| 25 | <div className="flex items-center gap-1.5"> |
| 26 | <h3 className={ titleClassName }>{ title }</h3> |
| 27 | { titleAddon } |
| 28 | </div> |
| 29 | ) : ( |
| 30 | <h3 className={ titleClassName }>{ title }</h3> |
| 31 | ) ) } |
| 32 | { description && ( |
| 33 | <Text size="sm" className="text-text-secondary mt-1"> |
| 34 | { description } |
| 35 | </Text> |
| 36 | ) } |
| 37 | </div> |
| 38 | ) } |
| 39 | { children } |
| 40 | </div> |
| 41 | ); |
| 42 | }; |
| 43 | |
| 44 | export default SectionCard; |
| 45 |