diff --git a/apps/react/src/app/features/online-board/components/board-flight-body.scss b/apps/react/src/app/features/online-board/components/board-flight-body.scss index 5de49923b..15c1035e0 100644 --- a/apps/react/src/app/features/online-board/components/board-flight-body.scss +++ b/apps/react/src/app/features/online-board/components/board-flight-body.scss @@ -2,25 +2,112 @@ padding: 16px; background: #fafafa; border-top: 1px solid #e0e0e0; + display: flex; + flex-direction: column; + gap: 16px; +} + +.board-flight-body__content { + display: flex; + flex-direction: column; + gap: 16px; } .board-flight-body__section { - margin-bottom: 16px; + display: flex; + flex-direction: column; + gap: 8px; +} - &:last-child { - margin-bottom: 0; +.board-flight-body__section-title { + margin: 0; + font-size: 13px; + font-weight: 600; + color: #666; + text-transform: uppercase; + letter-spacing: 0.5px; +} + +.board-flight-body__info-grid { + display: grid; + grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); + gap: 12px; + + @media (max-width: 768px) { + grid-template-columns: repeat(2, 1fr); } - h3 { - margin: 0 0 8px 0; - font-size: 14px; - font-weight: 600; - color: #333; - } - - p { - margin: 0; - color: #666; - font-size: 14px; + @media (max-width: 480px) { + grid-template-columns: 1fr; + } +} + +.board-flight-body__info-item { + display: flex; + flex-direction: column; + gap: 4px; + padding: 8px; + background: white; + border-radius: 4px; + border: 1px solid #e0e0e0; +} + +.board-flight-body__label { + font-size: 11px; + color: #999; + text-transform: uppercase; + font-weight: 500; +} + +.board-flight-body__value { + font-size: 14px; + color: #333; + font-weight: 500; + display: flex; + flex-direction: column; + gap: 2px; +} + +.board-flight-body__city { + font-size: 12px; + color: #999; + font-weight: 400; +} + +.board-flight-body__actual { + font-size: 12px; + color: #f57c00; + font-weight: 500; +} + +.board-flight-body__codesharing-list { + display: flex; + flex-wrap: wrap; + gap: 8px; +} + +.board-flight-body__codeshare-badge { + padding: 4px 10px; + background: #e3f2fd; + color: #1565c0; + border-radius: 4px; + font-size: 12px; + font-weight: 500; +} + +.board-flight-body__actions { + display: flex; + gap: 8px; + justify-content: flex-end; + padding-top: 8px; + border-top: 1px solid #e0e0e0; + + :global { + .p-button { + &.p-button-sm { + padding: 6px 12px; + font-size: 12px; + } + } } } diff --git a/apps/react/src/app/features/online-board/components/board-flight-body.tsx b/apps/react/src/app/features/online-board/components/board-flight-body.tsx index 64d5489d4..b95dc4190 100644 --- a/apps/react/src/app/features/online-board/components/board-flight-body.tsx +++ b/apps/react/src/app/features/online-board/components/board-flight-body.tsx @@ -1,20 +1,186 @@ import React from 'react' +import { Button } from 'primereact/button' +import { useNavigate } from 'react-router-dom' +import { useTranslation } from 'react-i18next' import './board-flight-body.scss' export interface BoardFlightBodyProps { - flight: any + flight: { + id: string + flightNumber: string + departure: { + airport: string + city: string + scheduled: string + actual?: string + terminal?: string + gate?: string + } + arrival: { + airport: string + city: string + scheduled: string + actual?: string + terminal?: string + gate?: string + } + boarding?: { + time: string + gate: string + } + deboarding?: { + time: string + gate: string + } + codesharing?: string[] + } } export const BoardFlightBody: React.FC = ({ flight }) => { + const navigate = useNavigate() + const { t } = useTranslation() + + const handleViewDetails = () => { + // Navigate to full flight details page + const params = btoa(JSON.stringify({ id: flight.id, flightNumber: flight.flightNumber })) + navigate(`/onlineboard/${params}`) + } + return (
-
-

Departure

-

{flight.departure.airport} - {flight.departure.city}

+
+ {/* Departure Section */} +
+

{t('SHARED.DEPARTURE')}

+
+
+ {t('SHARED.AIRPORT')} + + {flight.departure.airport} + {flight.departure.city} + +
+
+ {t('SHARED.TIME')} + + {flight.departure.scheduled} + {flight.departure.actual && ( + {flight.departure.actual} + )} + +
+ {flight.departure.terminal && ( +
+ {t('SHARED.TERMINAL')} + {flight.departure.terminal} +
+ )} + {flight.departure.gate && ( +
+ {t('SHARED.GATE')} + {flight.departure.gate} +
+ )} +
+
+ + {/* Boarding Section */} + {flight.boarding && ( +
+

{t('BOARD.BOARDING')}

+
+
+ {t('SHARED.TIME')} + {flight.boarding.time} +
+ {flight.boarding.gate && ( +
+ {t('SHARED.GATE')} + {flight.boarding.gate} +
+ )} +
+
+ )} + + {/* Arrival Section */} +
+

{t('SHARED.ARRIVAL')}

+
+
+ {t('SHARED.AIRPORT')} + + {flight.arrival.airport} + {flight.arrival.city} + +
+
+ {t('SHARED.TIME')} + + {flight.arrival.scheduled} + {flight.arrival.actual && ( + {flight.arrival.actual} + )} + +
+ {flight.arrival.terminal && ( +
+ {t('SHARED.TERMINAL')} + {flight.arrival.terminal} +
+ )} + {flight.arrival.gate && ( +
+ {t('SHARED.GATE')} + {flight.arrival.gate} +
+ )} +
+
+ + {/* Deboarding Section */} + {flight.deboarding && ( +
+

{t('BOARD.DEBOARDING')}

+
+
+ {t('SHARED.TIME')} + {flight.deboarding.time} +
+ {flight.deboarding.gate && ( +
+ {t('SHARED.GATE')} + {flight.deboarding.gate} +
+ )} +
+
+ )} + + {/* Codesharing Section */} + {flight.codesharing && flight.codesharing.length > 0 && ( +
+

{t('BOARD.CODESHARING')}

+
+ {flight.codesharing.map((code, idx) => ( + + {code} + + ))} +
+
+ )}
-
-

Arrival

-

{flight.arrival.airport} - {flight.arrival.city}

+ + {/* Action Buttons */} +
+
)