import { FC } from "react";
import styles from "../styling/achievements.module.scss";

export type AwardArgs = {
	institution : string,
	awardDate: string,
	title : string,
	city : "Warsaw" | "London" | "Edinburgh",
	notes? : string[]
}

const Award : FC<AwardArgs> = (props) => {

	const getCountryEmoji = (): string => {
		switch (props.city) {
			case "Warsaw":
				return ", PL";
			case "London":
				return ", UK󠁧󠁢󠁥󠁮󠁧󠁿";
			case "Edinburgh":
				return ", UK󠁧󠁢󠁳󠁣󠁴󠁿";
		}
	};

	return (
		<div className={styles.education} data-aos={"fade-left"}>
			<div>
				<span className={styles.title}>{props.title}</span>
				<br/>
				from <i>{props.institution}</i>
				{props.notes?
					<ul className={styles.notes}>
						{props.notes.map((note, index) =>
							<li key={index}>
								{note}
							</li>
						)}
					</ul>
					: ""
				}
			</div>
			<span className={styles.otherDetails}>
				<div className={styles.location}>{props.city}{getCountryEmoji()}</div>
				<hr/>
				{props.awardDate}
			</span>
		</div>
	);
};

export default Award;
