import { PageType } from '@/constants/pageTypes'; import AccountTreeIcon from '@mui/icons-material/AccountTree'; import AddIcon from '@mui/icons-material/Add'; import HelpIcon from '@mui/icons-material/Help'; import InfoIcon from '@mui/icons-material/Info'; export function getBuildInPageIcon(pageType: PageType): React.JSX.Element { switch (pageType) { case PageType.wiki: { // this won't happened, because wiki page is not a build-in page return
Wiki
; } case PageType.help: { return ; } case PageType.guide: { return ; } case PageType.agent: { return ; } case PageType.add: { return ; } } // don't return null here. If you get `Function lacks ending return statement and return type does not include 'undefined'.ts(2366)`, you must forget to provide an icon for a newly added page type here. }