import LinkCard from "@/components/LinkViews/LinkCard"; import { LinkIncludingShortenedCollectionAndTags } from "@/types/global"; import { GridLoader } from "react-spinners"; import Masonry from "react-masonry-css"; import resolveConfig from "tailwindcss/resolveConfig"; import tailwindConfig from "../../../tailwind.config.js"; import { useMemo } from "react"; export default function MasonryView({ links, editMode, isLoading, }: { links: LinkIncludingShortenedCollectionAndTags[]; editMode?: boolean; isLoading?: boolean; }) { const fullConfig = resolveConfig(tailwindConfig as any); const breakpointColumnsObj = useMemo(() => { return { default: 4, 1900: 3, [fullConfig.theme.screens.xl]: 2, [fullConfig.theme.screens.sm]: 1, }; }, []); return ( {links.map((e, i) => { return ( ); })} {isLoading && links.length > 0 && ( )} ); }