import { FC } from 'react'; import styles from './Profile.module.scss'; interface ProfileProps { type: 'F' | 'PAX'; isER: boolean; upper1: string; upper1max?: string; upper2: string; upper2max?: string; upper3: string; upper3max?: string; upper4: string; upper4max?: string; lower1: string; lower2: string; OEW: string; crew: string; CGs: [string, boolean, string, boolean]; unit: string; inPreview: boolean; done: boolean; } const Profile: FC = ({ type, isER, upper1, upper1max, upper2, upper2max, upper3, upper3max, upper4, upper4max, lower1, lower2, OEW, crew, CGs, unit, inPreview, done, }) => { const previewClass = inPreview ? styles['fill-neutral-500'] : undefined; const doneClass = done ? undefined : styles['fill-neutral-500']; const ZFWCGClass = CGs[1] ? styles['fill-red-500'] : doneClass; const TOCGClass = CGs[3] ? styles['fill-red-500'] : doneClass; return ( {upper1} {upper1max && /{upper1max}} {upper2} {upper2max && /{upper2max}} {upper3} {upper3max && /{upper3max}} {upper4} {upper4max && /{upper4max}} {lower1} {lower2} {type === 'F' ? 'Pilots:' : 'Pilots & FAs:'} {crew} OEW: {OEW} all in {unit} TOCG: {CGs[2]} ZFWCG: {CGs[0]} ); }; export default Profile;