/* eslint-disable react/no-unused-prop-types */ import Image from "next/image"; import type { PropsWithChildren } from "react"; import type { ButtonProps } from "@/components/ui/button/button"; import { Button } from "@/components/ui/button/button"; import Card from "@/components/ui/card/card"; import { Carousel } from "@/components/ui/carousel/carousel"; import type { LIconProps } from "@/components/ui/lucid-icon/lucid-icon"; import LIcon from "@/components/ui/lucid-icon/lucid-icon"; import { cn } from "@/libs/utils"; export interface FlightBrandProps { logoSrc: string; brandName: string; flightCode: string; } interface FlightTimeProps { totalFlightHours: string; flightStartTime: string; startIATACode: string; endStartTime: string; endIATACode: string; transferInformation: string; transferIATACodes?: string; } interface FlightInformationProps extends PropsWithChildren { seatInformation?: string; baggageInformation?: string; flightClass: string; } interface FlightPriceProps { price: string; isOptimal?: boolean; } interface FlightDetailActionProps { infoText?: string; onClick: () => void; isOpen: boolean; operatingCompanies?: string[]; buttonVariant?: ButtonProps["variant"]; buttonText?: string; renderActionButton?: () => React.ReactNode; } interface FlightDetailProps extends PropsWithChildren { active: boolean; } interface FlightProperties { icon?: LIconProps; text: string; } interface FlightDetailCardProps { flightClass: string; price: string; properties: FlightProperties[]; buttonOnClick?: () => void; } const FlightCard = ({ children }: PropsWithChildren) => { return (
{children}
); }; const FlightBrand = ({ logoSrc, brandName, flightCode }: FlightBrandProps) => { return (
{brandName} {flightCode}
); }; const FlightTime = ({ totalFlightHours, flightStartTime, startIATACode, endStartTime, endIATACode, transferInformation, transferIATACodes, }: FlightTimeProps) => { return (
{totalFlightHours}
{flightStartTime} {startIATACode}
----
----{">"}
{endStartTime} {endIATACode}
{transferInformation} {transferIATACodes}
); }; const FlightInformation = ({ seatInformation, baggageInformation, flightClass, children, }: FlightInformationProps) => { return (
{seatInformation && ( {seatInformation} )} {baggageInformation && (
{baggageInformation} /
)} {flightClass}
{children}
); }; const FlightPrice = ({ price }: FlightPriceProps) => { return (
{/* This field hidden. When you need it, you can use it. {isOptimal && En uygun fiyat} */}
{price} Kişi Başı
); }; const FlightDetailAction = ({ infoText, operatingCompanies, onClick, buttonVariant, buttonText, renderActionButton, }: FlightDetailActionProps) => { return (
{operatingCompanies && operatingCompanies.map((item, key) => (
{item}
))}
{infoText && (
{infoText}
)}
{renderActionButton?.() ?? ( )}
); }; const FlightDetail = ({ active, children }: FlightDetailProps) => { return (
{children}
); }; const FligtDetailCardProperties = ({ icon, text }: FlightProperties) => { return (
{icon && } {text}
); }; const FlightDetailCard = ({ flightClass, price, properties, buttonOnClick, }: FlightDetailCardProps) => { return (
{flightClass} {properties.map((item, key) => ( ))}
{price}
); }; export { FlightBrand, FlightCard, FlightDetail, FlightDetailAction, FlightDetailCard, FlightInformation, FlightPrice, FlightTime, };