import React, { FC, ReactNode, useMemo } from 'react'; import { Filler } from '~/components/containers/Filler'; import { Button } from '~/components/input/Button'; import styles from './styles.module.scss'; interface SidebarStackCardProps { width?: number; headerFeature?: 'back' | 'close'; title?: ReactNode; onBackPress?: () => void; } const SidebarStackCard: FC = ({ children, title, width, headerFeature, onBackPress, }) => { const style = useMemo(() => ({ maxWidth: width, flexBasis: width }), [width]); const backIcon = headerFeature === 'close' ? 'close' : 'right'; return (
{!!(headerFeature || title) && (
{typeof title === 'string' ?
{title}
: title}
{!!(headerFeature && onBackPress) && (
)}
{children}
); }; export { SidebarStackCard };