import React from "react"; import { Box, Typography } from "@mui/material"; import crown from "../../assets/crown.svg"; const PageTitle = () => { const text = "Leaderboards on the Hub"; const words = text.split(" "); // Find the position of the first 'd' const firstDIndex = text.toLowerCase().indexOf("d"); let letterCount = 0; return ( {words.map((word, wordIndex) => ( {word.split("").map((letter, letterIndex) => { const isFirstD = letterCount === firstDIndex; letterCount++; return ( {isFirstD && ( theme.palette.mode === "dark" ? "invert(1) brightness(2)" : "none", }} /> )} {letter} ); })} {wordIndex < words.length - 1 && "\u00A0"} ))} ); }; export default PageTitle;