import { useNavigate } from "react-router-dom"; import { useState } from "react"; import ReactMarkdown from "react-markdown"; import remarkMath from "remark-math"; import rehypeKatex from "rehype-katex"; import { BenchmarkData } from "../../types"; import { BenchmarkCharts } from "../benchmark/charts/BenchmarkCharts"; import { BenchmarkTable } from "../benchmark/table/BenchmarkTable"; import "./ContentStyles.css"; export interface BaseItem { name: string; description: string; long_description?: string; version: string; tags: string[]; source_file?: string; } interface BaseContentProps { item: BaseItem; benchmarkData: BenchmarkData | null; chartData: Array<{ algorithmOrDataset: string; compression_ratio: number; reference_compression_ratio: number | null; encode_speed: number; decode_speed: number; }>; tagNavigationPrefix: string; filterKey: "dataset" | "algorithm"; downloadSection?: React.ReactNode; additionalContent?: React.ReactNode; showSortByCompressionRatio?: boolean; } export const BaseContent = ({ item, benchmarkData, chartData, tagNavigationPrefix, filterKey, downloadSection, additionalContent, showSortByCompressionRatio, }: BaseContentProps) => { const navigate = useNavigate(); const [isExpanded, setIsExpanded] = useState(false); return (
{item.name} | {item.description}
{item.long_description && ( <> {isExpanded && (