import classNames from 'classnames';
import React from 'react';

type Props = {
  marker: React.ReactNode;
  children: React.ReactNode;
  className?: string | undefined;
};

/**
 * Marked children
 * @param {React.ReactNode} marker Marker component
 * @return {React.ReactNode}
 */
export default function MarkedItem({
  marker,
  children,
  className,
}: Props): JSX.Element {
  return (
    <div
      className={classNames(
          'flex flex-col sm:flex-row text-center',
          'sm:text-left items-center sm:items-start',
          className,
      )}
    >
      <div className="flex-none mb-4 sm:mb-0">{marker}</div>
      <div className="flex-1 sm:ml-6">{children}</div>
    </div>
  );
}
