fix(blog): fix url to blog page

This commit is contained in:
Alexander Navarro 2024-07-28 12:02:25 -04:00
parent 11f447d91d
commit 218af8bcf1
7 changed files with 43 additions and 83 deletions

View file

@ -48,8 +48,10 @@ 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.hasCustomCell) {
return <div dangerouslySetInnerHTML={{ __html: data.customCell }} />;
if (header.hasCustomCell && header.formatter) {
return (
<div dangerouslySetInnerHTML={{ __html: header.formatter(data) }} />
);
}
if (header.type === HeaderType.Multiple) {

View file

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