/* * Copyright (c) 2026 by Christian Kellner. * Licensed under Apache-2.0 with Commons Clause and Attribution/Naming Clause */ import { Button, Tooltip } from '@douyinfe/semi-ui-19'; import { IconBriefcase, IconCart, IconDelete, IconLink, IconMapPin, IconStar, IconStarStroked, IconEyeOpened, } from '@douyinfe/semi-icons'; import no_image from '../../assets/no_image.png'; import * as timeService from '../../services/time/timeService.js'; import StatusControl from '../listings/StatusControl.jsx'; import './ListingsTable.less'; /** * @param {{ listings: object[], onWatch: Function, onNavigate: Function, onDelete: Function, onStatusChange: Function }} props */ const ListingsTable = ({ listings, onWatch, onNavigate, onDelete, onStatusChange }) => (
{listings.map((item) => (
onNavigate(item.id)} onKeyDown={(e) => { if (e.key === 'Enter' || e.key === ' ') onNavigate(item.id); }} >
{item.title} { e.target.src = no_image; }} />
{item.title}
{item.price ? ( <> {item.price} ) : ( --- )}
{item.address ? ( <> {item.address} ) : ( --- )}
{item.provider}
{timeService.format(item.created_at, false)}
e.stopPropagation()}> onStatusChange?.(item, next)} onTriggerClick={(e) => e.stopPropagation()} />
))}
); export default ListingsTable;