import Link from '../Link';
import styles from './Positions.module.scss';
import { Link as LinkI } from '../../models/common';

export type Props = {
  title: string;
  link: LinkI;
};

const Positions = (props: Props): JSX.Element => {
  const { title, link } = props;
  return (
    <div className={styles.positions}>
      <div className={styles.container}>
        <div className={styles.firstCol}>
          <h1>{title}</h1>
        </div>
        <div className={styles.secondCol}>
          {link?.url && (
            <Link
              href={link?.url}
              type={link.style?.type}
              iconSize={link.style?.iconSize}
              textSize={link.style?.textSize}
              isIconFirst={link.style?.isIconFirst}
            >
              {link?.label}
            </Link>
          )}
        </div>
      </div>
    </div>
  );
};
export default Positions;
