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.

41 lines
1.6 KiB

  1. import { User } from "@/types";
  2. import { PropsWithChildren } from "react";
  3. import { Layout } from "react-feather";
  4. import SystemAnnouncement from "./SystemAnnouncement";
  5. import PinnedProjects from "./PinnedProjects";
  6. export default function BulletinBoard({ user }: PropsWithChildren<{ user: User }>) {
  7. const thisUser = user;
  8. const renderBulletinBoardContent = () => {
  9. switch (thisUser.role_id) {
  10. case 1:
  11. return null;
  12. case 2:
  13. return (
  14. <div className="flex">
  15. <section className="w-1/3"><SystemAnnouncement /></section>
  16. <div className="divider divider-horizontal"></div>
  17. <section className="w-full"><PinnedProjects user={thisUser} /></section>
  18. </div>
  19. );
  20. case 3:
  21. return (
  22. <div className="flex">
  23. <section className="w-1/3"><SystemAnnouncement /></section>
  24. <div className="divider divider-horizontal"></div>
  25. <section className="w-full"><PinnedProjects user={thisUser} /></section>
  26. </div>
  27. );
  28. default:
  29. return null;
  30. }
  31. }
  32. return (
  33. <div className="h-full w-full bg-neutral-10 shadow-md p-6 rounded-lg">
  34. <p className="font-bold text-xl text-primary-main flex items-center"><Layout className="stroke-primary-main mr-2" />Bulletin Board</p>
  35. <div className="divider"></div>
  36. {renderBulletinBoardContent()}
  37. </div>
  38. )
  39. }