diff --git a/apps/nextjs/src/app/[locale]/manage/boards/_components/board-preview.tsx b/apps/nextjs/src/app/[locale]/manage/boards/_components/board-preview.tsx new file mode 100644 index 000000000..352d9cb53 --- /dev/null +++ b/apps/nextjs/src/app/[locale]/manage/boards/_components/board-preview.tsx @@ -0,0 +1,83 @@ +"use client"; + +import { Box, Card, Center, Flex, Loader, Text } from "@mantine/core"; +import { useElementSize } from "@mantine/hooks"; +import dayjs from "dayjs"; + +import type { RouterOutputs } from "@homarr/api"; + +interface BoardPreviewProps { + board: RouterOutputs["board"]["getAllBoards"][number]; +} + +export const BoardPreview = ({ board }: BoardPreviewProps) => { + const { ref, width } = useElementSize(); + + return ( + + {width === 0 ? ( +
+ +
+ ) : ( + <> + {board.sections.map((section) => ( +
+ ))} + + )} + + ); +}; + +interface SectionProps { + section: RouterOutputs["board"]["getAllBoards"][number]["sections"][number]; + itemWidth: number; +} + +const Section = ({ section, itemWidth }: SectionProps) => { + const maxHeight = Math.max( + ...section.items.map((item) => item.yOffset + item.height), + ); + + return ( + + {section.items.map((item) => ( + + + + {dayjs().format("HH:mm")} + + + + ))} + + ); +}; diff --git a/apps/nextjs/src/app/[locale]/manage/boards/page.tsx b/apps/nextjs/src/app/[locale]/manage/boards/page.tsx index cf0a52532..b8c9eeb88 100644 --- a/apps/nextjs/src/app/[locale]/manage/boards/page.tsx +++ b/apps/nextjs/src/app/[locale]/manage/boards/page.tsx @@ -15,12 +15,16 @@ import { } from "@mantine/core"; import { IconDotsVertical, IconLock, IconWorld } from "@tabler/icons-react"; +import "~/styles/gridstack.scss"; + import type { RouterOutputs } from "@homarr/api"; import { api } from "@homarr/api/server"; import { getScopedI18n } from "@homarr/translation/server"; +import { UserAvatar } from "@homarr/ui"; import { getBoardPermissions } from "~/components/board/permissions/server"; import { BoardCardMenuDropdown } from "./_components/board-card-menu-dropdown"; +import { BoardPreview } from "./_components/board-preview"; import { CreateBoardButton } from "./_components/create-board-button"; export default async function ManageBoardsPage() { @@ -37,7 +41,7 @@ export default async function ManageBoardsPage() { {boards.map((board) => ( - + ))} @@ -68,9 +72,22 @@ const BoardCard = async ({ board }: BoardCardProps) => { {board.name} + + {board.creator && ( + + + + {board.creator?.name} + + + )} + + + +