Add new "feature" prop

This commit is contained in:
danidfra 2024-09-27 21:18:13 -03:00
parent d77ca78a3a
commit ed2871b5c2
1 changed files with 20 additions and 14 deletions

View File

@ -61,11 +61,13 @@ export interface IColumn {
action?: React.ReactNode; action?: React.ReactNode;
/** Column size, inherited from Card. */ /** Column size, inherited from Card. */
size?: CardSizes; size?: CardSizes;
/** Extra feature. */
feature?: JSX.Element;
} }
/** A backdrop for the main section of the UI. */ /** A backdrop for the main section of the UI. */
const Column: React.FC<IColumn> = React.forwardRef((props, ref: React.ForwardedRef<HTMLDivElement>): JSX.Element => { const Column: React.FC<IColumn> = React.forwardRef((props, ref: React.ForwardedRef<HTMLDivElement>): JSX.Element => {
const { backHref, children, label, transparent = false, withHeader = true, className, bodyClassName, action, size } = props; const { backHref, children, label, transparent = false, withHeader = true, className, bodyClassName, action, size, feature } = props;
const soapboxConfig = useSoapboxConfig(); const soapboxConfig = useSoapboxConfig();
const [isScrolled, setIsScrolled] = useState(false); const [isScrolled, setIsScrolled] = useState(false);
@ -97,6 +99,7 @@ const Column: React.FC<IColumn> = React.forwardRef((props, ref: React.ForwardedR
<Card size={size} variant={transparent ? undefined : 'rounded'} className={className}> <Card size={size} variant={transparent ? undefined : 'rounded'} className={className}>
{withHeader && ( {withHeader && (
<div className='flex justify-between'>
<ColumnHeader <ColumnHeader
label={label} label={label}
backHref={backHref} backHref={backHref}
@ -109,8 +112,11 @@ const Column: React.FC<IColumn> = React.forwardRef((props, ref: React.ForwardedR
})} })}
action={action} action={action}
/> />
)}
{feature}
</div>
)}
<CardBody className={bodyClassName}> <CardBody className={bodyClassName}>
{children} {children}
</CardBody> </CardBody>