import { useParams } from "react-router-dom"; import { Algorithm as AlgorithmType } from "../types"; interface AlgorithmProps { algorithms: AlgorithmType[]; } function Algorithm({ algorithms }: AlgorithmProps) { const { algorithmName } = useParams<{ algorithmName: string }>(); const algorithm = algorithms.find((a) => a.name === algorithmName); if (!algorithm) { return
Algorithm not found
; } return (

{algorithm.name}

{algorithm.description}

Version

{algorithm.version}

Tags

{algorithm.tags.map((tag) => ( {tag} ))}
{algorithm.source_file && (

Source

View Source
)}
); } export default Algorithm;