ぼざクリタグ広場 https://hub.nizika.monster
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

47 lines
1.3 KiB

  1. import { Helmet } from 'react-helmet-async'
  2. import PrefetchLink from '@/components/PrefetchLink'
  3. import { menuOutline } from '@/components/TopNav'
  4. import SectionTitle from '@/components/common/SectionTitle'
  5. import MainArea from '@/components/layout/MainArea'
  6. import { SITE_TITLE } from '@/config'
  7. import type { FC } from 'react'
  8. import type { User } from '@/types'
  9. export default (() => {
  10. const menu = menuOutline (
  11. { tag: null, wikiId: null, user: { } as User, pathName: location.pathname })
  12. return (
  13. <MainArea className="md:flex">
  14. <Helmet>
  15. <title>{`メニュー | ${ SITE_TITLE }`}</title>
  16. </Helmet>
  17. {[...Array (Math.ceil (menu.length / 4)).keys ()].map (i => (
  18. <div key={i} className="flex-1 mx-16">
  19. {menu.slice (4 * i, 4 * (i + 1)).map ((item, j) => (
  20. <section key={j}>
  21. <SectionTitle className="font-bold">{item.name}</SectionTitle>
  22. <ul>
  23. {item.subMenu
  24. .filter (subItem => (subItem.visible ?? true))
  25. .map ((subItem, k) => ('name' in subItem && (
  26. <li key={k}>
  27. <PrefetchLink
  28. to={subItem.to}
  29. target={subItem.to.slice (0, 2) === '//'
  30. ? '_blank'
  31. : undefined}>
  32. {subItem.name}
  33. </PrefetchLink>
  34. </li>)))}
  35. </ul>
  36. </section>))}
  37. </div>))}
  38. </MainArea>)
  39. }) satisfies FC