import { router } from "expo-router"

export function pushToPage(category: string, idContent: string) {
   const cat = category.split('/')
   if (cat.length > 1) {
      if (cat[2] == 'calendar') {
         return router.push(`/division/${cat[1]}/calendar/${idContent}`)
      } else if (cat[2] == 'discussion') {
         return router.push(`/division/${cat[1]}/discussion/${idContent}`)
      } else if (cat[2] == 'document') {
         return router.push(`/division/${cat[1]}/document/${idContent}`)
      } else if (cat[2] == 'task') {
         return router.push(`/division/${cat[1]}/task/${idContent}`)
      }
   } else {
      if (cat[0] == 'announcement') {
         return router.push(`/announcement/${idContent}`)
      } else if (cat[0] == 'discussion-general') {
         return router.push(`/discussion/${idContent}`)
      } else if (cat[0] == 'division') {
         return router.push(`/division/${idContent}`)
      } else if (cat[0] == 'member') {
         return router.push(`/member/${idContent}`)
      } else if (cat[0] == 'project') {
         return router.push(`/project/${idContent}`)
      } else if (cat[0] == 'group') {
         return router.push(`/group`)
      } else if (cat[0] == 'position') {
         return router.push(`/position`)
      }
   }
}