diff --git a/todoblue/src/app/board/[board]/BoardMain.tsx b/todoblue/src/app/board/[board]/BoardMain.tsx new file mode 100644 index 0000000..db38288 --- /dev/null +++ b/todoblue/src/app/board/[board]/BoardMain.tsx @@ -0,0 +1,22 @@ +import {BoardMainTaskGroups} from "@/app/board/[board]/BoardMainTaskGroups" +import {BoardMainIcon} from "@/app/board/[board]/BoardMainIcon" +import {useBoardContext} from "@/app/board/[board]/useBoardContext" +import {FontAwesomeIcon} from "@fortawesome/react-fontawesome" +import {faGear, faArrowsSpin, faExclamationCircle} from "@fortawesome/free-solid-svg-icons" + + +export function BoardMain() { + const {websocketState} = useBoardContext() + + switch(websocketState) { + case undefined: + return } text={"Caricamento..."}/> + case WebSocket.CONNECTING: + return } text={"Connessione..."}/> + case WebSocket.OPEN: + return + case WebSocket.CLOSING: + case WebSocket.CLOSED: + return } text={"Errore"} className={"red"}/> + } +} diff --git a/todoblue/src/app/board/[board]/BoardMainTaskGroups.tsx b/todoblue/src/app/board/[board]/BoardMainTaskGroups.tsx index db9ac16..0c386c6 100644 --- a/todoblue/src/app/board/[board]/BoardMainTaskGroups.tsx +++ b/todoblue/src/app/board/[board]/BoardMainTaskGroups.tsx @@ -6,8 +6,8 @@ export function BoardMainTaskGroups() { const {taskGroups} = useBoardContext() return ( -
+
{taskGroups.map((tg) => )} -
+ ) }