diff --git a/src/features/online-board/components/OnlineBoardSearchPage.tsx b/src/features/online-board/components/OnlineBoardSearchPage.tsx index e69a6e85..a89117fd 100644 --- a/src/features/online-board/components/OnlineBoardSearchPage.tsx +++ b/src/features/online-board/components/OnlineBoardSearchPage.tsx @@ -18,6 +18,7 @@ import { useNavigate } from "@modern-js/runtime/router"; import { useLocale } from "@/i18n/useLocale.js"; import { useTranslation } from "@/i18n/provider.js"; import { FlightList } from "@/ui/flights/FlightList.js"; +import { FlightActions } from "./BoardDetailsHeader/FlightActions.js"; import { findClosestFlightId } from "../closestFlight.js"; import { PageLayout } from "@/ui/layout/PageLayout.js"; import { PageTabs } from "@/ui/layout/PageTabs.js"; @@ -514,6 +515,18 @@ export const OnlineBoardSearchPage: FC = ({ onFlightClick={handleFlightClick} initialCurrentFlightId={initialCurrentFlightId} direction={params.type} + renderActions={(flight) => ( + // Mirrors Angular's board search expansion: each row + // shows [Купить] [Онлайн регистрация] alongside the + // Details button. Visibility falls through to the + // same canBuyTicket / canRegister rules we use in the + // BoardDetailsHeader. + + )} /> )} diff --git a/src/ui/flights/FlightCard.tsx b/src/ui/flights/FlightCard.tsx index 510f8dbb..a62642be 100644 --- a/src/ui/flights/FlightCard.tsx +++ b/src/ui/flights/FlightCard.tsx @@ -46,6 +46,13 @@ export interface FlightCardProps { * pages to render the per-leg route diagram. */ renderExpandedBody?: (flight: ISimpleFlight) => ReactNode; + /** + * Extra action buttons rendered before the default share + details + * buttons in the expanded actions row. Used by the online-board + * search page to surface the same Купить / Онлайн регистрация + * buttons Angular shows on the search results expansion. + */ + renderActions?: (flight: ISimpleFlight) => ReactNode; } /** Extract the primary leg from a flight (first leg for multi-leg) */ @@ -116,6 +123,7 @@ export const FlightCard: FC = ({ onViewDetails, direction = "route", renderExpandedBody, + renderActions, }) => { const { t } = useTranslation(); const { language } = useLocale(); @@ -415,6 +423,12 @@ export const FlightCard: FC = ({ > + {/* Extra actions (Купить / Онлайн регистрация). Angular + renders Buy + Registration + Details here on every + expanded board row; the caller wires up FlightActions + via renderActions so the visibility rules live with + the feature instead of leaking into the ui layer. */} + {renderActions?.(flight)}