import React from "react";
import { Loading } from "./Loading";
import { Blank } from "./Blank";
import * as styles from "./styles";
import { useNeighborhoodShowcase } from "~/sdks/NeighborhoodShowcase/context";
import { useStateManagerContext } from "~/context/stateManager";
import { getNeighborhoodURLFromSchema } from "~/utils/formatters/neighborhoodURLSchema";
import { NeighborhoodCard } from "~/components/NeighborhoodCard";
export const NeighborhoodCardList = () => {
    var _a;
    const { myNeighborhoods, singleNeighborhoodURLSchema, isFetched } = useNeighborhoodShowcase();
    const { sdkState } = useStateManagerContext();
    const urlSpacer = ((_a = sdkState.options) === null || _a === void 0 ? void 0 : _a.urlSchemaSpacer) || "-";
    if (!isFetched) {
        return React.createElement(Loading, null);
    }
    if (!myNeighborhoods) {
        return React.createElement(Blank, null);
    }
    return (React.createElement(React.Fragment, null,
        React.createElement("div", { className: styles.container }, myNeighborhoods === null || myNeighborhoods === void 0 ? void 0 : myNeighborhoods.map((neighborhood, index) => (React.createElement("div", { key: index, className: styles.card },
            React.createElement(NeighborhoodCard, { href: singleNeighborhoodURLSchema &&
                    getNeighborhoodURLFromSchema(singleNeighborhoodURLSchema, neighborhood, urlSpacer), neighborhood: neighborhood })))))));
};
//# sourceMappingURL=index.js.map