import React from 'react';
import { TouchableComponent } from '../TouchableComponent';

type Props = React.ComponentProps<typeof TouchableComponent>;

export const CardContainer = ({
  children,
  onPress,
  disabled,
  ...props
}: Props) => {
  return (
    <TouchableComponent
      borderRadius={4}
      bg={'white'}
      alignItems={'center'}
      px={'spacing-s'}
      py={'spacing-s'}
      disabled={!onPress || disabled}
      onPress={(event) => {
        if (onPress) {
          onPress(event);
        }
      }}
      {...props}
    >
      {children}
    </TouchableComponent>
  );
};
