All files / src/components/common/TimeRangeSelector TimeSelectorDropDown.tsx

0% Statements 0/11
0% Branches 0/1
0% Functions 0/2
0% Lines 0/11

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31                                                             
import React, { useRef, useEffect } from "react";
import CustomTimeRangeSection from "./CustomTimeRangeSection.tsx";
import TimeRangeOptionsSection from "./TimeRangeOptionsSection.tsx";
import { useDropdownContext } from "../../../contexts/DropdownContext.tsx";
 
function TimeSelectorDropDown() {
  const { registerRef } = useDropdownContext();
  const customTimeRangeRef = useRef<HTMLDivElement>(null);
 
  useEffect(() => {
    Iif (customTimeRangeRef.current) {
      registerRef(customTimeRangeRef);
    }
  }, [customTimeRangeRef, registerRef]);
 
  return (
    <div
      ref={customTimeRangeRef}
      className="absolute bottom-3 right-0 translate-y-full bg-white border rounded w-[500px] h-[250px] flex">
      <div className="flex-1 w-full">
        <CustomTimeRangeSection />
      </div>
      <div className="flex-[0.8] border-l w-full">
        <TimeRangeOptionsSection />
      </div>
    </div>
  );
}
 
export default TimeSelectorDropDown;