import type { RefObject } from 'react'; import { useTranslation } from '../../i18n'; import type { TripFile } from '../../types'; import { EditorField, INPUT, LABEL, TEXTAREA } from '../shared/dialogParts'; import { BookingCostsSection } from './BookingCostsSection'; import { BookingLinkAndFiles } from './BookingLinkAndFiles'; import type { useBookingExpenseIntent } from './useBookingExpenseIntent'; import type { useBookingFileAttach } from './useBookingFileAttach'; /** * The lower part the booking and transport dialogs share: notes, the link and * files row, and the costs linked to this booking when the budget addon is on. */ export function BookingNotesFilesCosts({ notes, onNotesChange, url, onUrlChange, reservationId, tripFiles, pendingFiles, fileInputRef, attach, canAttach, showCosts, pendingExpense, expense, }: { notes: string; onNotesChange: (notes: string) => void; url: string; onUrlChange: (url: string) => void; /** The saved booking; unset while it is being created. */ reservationId: number | undefined; tripFiles: TripFile[]; pendingFiles: File[]; fileInputRef: RefObject; attach: ReturnType; canAttach: boolean; showCosts: boolean; pendingExpense: { total_price: number; currency?: string | null; category: string } | null; expense: ReturnType; }) { const { t } = useTranslation(); return ( <>