Update games to make them visible

This commit is contained in:
Alexander Navarro 2023-12-17 20:58:58 -03:00
parent 800d2a83b1
commit b6450742d1
7 changed files with 29 additions and 36 deletions

View file

@ -3,8 +3,8 @@ import { HeaderType, type Filter, type Value } from '../types.ts';
export { default as SelectFilter } from './SelectFilter.tsx';
export { default as NumberFilter } from './NumberFilter.tsx';
const filterString = (value: Value, data: any): boolean => {
return data.search(value) !== -1;
const filterString = (value: string, data: string): boolean => {
return data.toLowerCase().search(value.toLowerCase()) !== -1;
};
const filterNumber = (value: Value, data: any): boolean => {
if (!Array.isArray(value)) {

View file

@ -48,10 +48,8 @@ export default function Table({ data, headers }: Props): JSX.Element {
// and because Astro don't allow me to pass JSX from an Astro file to a TSX file,
// so I have to pass the formatted row as a string.
// DON'T use this method on a public API
if (header.formatter != null) {
return (
<div dangerouslySetInnerHTML={{ __html: header.formatter(data) }} />
);
if (header.hasCustomCell) {
return <div dangerouslySetInnerHTML={{ __html: data.customCell }} />;
}
if (header.type === HeaderType.Multiple) {

View file

@ -13,7 +13,7 @@ export enum HeaderType {
export interface Header {
key: string;
header: string;
formatter?: (data: DataItem) => string;
hasCustomCell: boolean;
type: HeaderType;
}