import { Paperclip, X } from 'lucide-react'; import React from 'react'; import type { TranslationFn } from '../../types'; import { fs } from '../shared/DialogShell'; import { Tooltip } from '../shared/Tooltip'; import { LABEL } from '../shared/dialogParts'; import PlaceImagePicker, { type PlaceImageOwn } from './PlaceImagePicker'; import { COLUMN_CARD, WHITE_BUTTON } from './placeDialogParts'; import { offersPictures, type ChosenImage } from './placeImageChoice'; /** Files chosen before the place exists: they are uploaded once the save has given it an id. */ export function PendingFiles({ files, fileRef, onAdd, onRemove, t, }: { files: File[]; fileRef: React.RefObject; onAdd: (e: React.ChangeEvent) => void; onRemove: (index: number) => void; t: TranslationFn; }) { return (
{t('files.title')}
{files.length > 0 && (
{files.map((file, idx) => (
))}
)}
); } /** * The place's picture in the form itself, where no details column stands * beside it (place details switched off): the same picker, with the place's * own pictures and an upload, under the field's label. */ export function PlaceImageSection({ image, onPickUrl, t, }: { image: { own: PlaceImageOwn; chosen: ChosenImage }; onPickUrl: (url: string | null) => void; t: TranslationFn; }) { if (!offersPictures([], image.own)) return null; return (
{t('places.details.pickImage')}
); }