import classNames from 'classnames';
import type { Column } from './select-market-columns';
import { columnHeaders } from './select-market-columns';
export const SelectMarketTableHeader = ({
detailed = false,
headers = columnHeaders,
}) => {
return (
{headers.map(({ kind, value, className, onlyOnDetailed }) => {
const thClass = classNames(
'font-normal text-neutral-500 dark:text-neutral-400',
className
);
if (!onlyOnDetailed || detailed === onlyOnDetailed) {
return (
{value}
|
);
}
return null;
})}
);
};
export const SelectMarketTableRow = ({
detailed = false,
columns,
onSelect,
marketId,
}: {
detailed?: boolean;
columns: Column[];
onSelect: (id: string) => void;
marketId: string;
}) => {
return (
{
onSelect(marketId);
}}
data-testid={`market-link-${marketId}`}
>
{columns.map(({ kind, value, className, dataTestId, onlyOnDetailed }) => {
if (!onlyOnDetailed || detailed === onlyOnDetailed) {
const tdClass = classNames(className);
return (
{value}
|
);
}
return null;
})}
);
};