var __rest = (this && this.__rest) || function (s, e) {
    var t = {};
    for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
        t[p] = s[p];
    if (s != null && typeof Object.getOwnPropertySymbols === "function")
        for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
            if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
                t[p[i]] = s[p[i]];
        }
    return t;
};
import { isBefore } from "date-fns";
import React, { forwardRef } from "react";
import { useTimelineContext } from "../hooks/useTimelineContext.js";
import PinInternal from "./PinInternal.js";
export const Pin = forwardRef((_a, forwardedRef) => {
    var { date } = _a, restProps = __rest(_a, ["date"]);
    const { startDate, endDate } = useTimelineContext();
    /**
     * Out-of-bounds pins should not be rendered
     */
    if (isBefore(date, startDate) || isBefore(endDate, date)) {
        return null;
    }
    return React.createElement(PinInternal, Object.assign({ ref: forwardedRef }, restProps, { date: date }));
});
Pin.componentType = "pin";
export default Pin;
//# sourceMappingURL=Pin.js.map