import React, { ButtonHTMLAttributes, ElementType } from 'react'; import Tappable from '../Tappable/Tappable'; import getClassName from '../../helpers/getClassName'; import classNames from '../../lib/classNames'; import usePlatform from '../../hooks/usePlatform'; import { HasAlign } from '../../types'; export interface CellButtonProps extends ButtonHTMLAttributes, HasAlign { mode?: 'primary' | 'danger'; before?: React.ReactNode; Component?: ElementType; stopPropagation?: boolean; href?: string; target?: string; } const CellButton: React.FunctionComponent = ({ className, align, mode, before, children, stopPropagation, Component, ...restProps }: CellButtonProps) => { const platform = usePlatform(); return (
{before &&
{before}
} {children &&
{children}
}
); }; CellButton.defaultProps = { mode: 'primary', Component: 'button', align: 'left', stopPropagation: true, }; export default CellButton;