import clsx from "clsx"; import * as React from "react"; import DateCard from "@/components/date-card"; import { usePoll } from "@/components/poll-context"; import ControlledScrollArea from "./controlled-scroll-area"; import { usePollContext } from "./poll-context"; import Score from "./score"; const TimeRange: React.VoidFunctionComponent<{ startTime: string; endTime: string; className?: string; }> = ({ startTime, endTime, className }) => { return (
{startTime}
{endTime}
); }; const PollHeader: React.VoidFunctionComponent = () => { const { options, getParticipantsWhoVotedForOption, highScore } = usePoll(); const { activeOptionId, setActiveOptionId, columnWidth } = usePollContext(); return ( {options.map((option) => { const { optionId } = option; const numVotes = getParticipantsWhoVotedForOption(optionId).length; return (
setActiveOptionId(optionId)} onMouseOut={() => setActiveOptionId(null)} >
0 ? ( 1 && highScore === numVotes} /> ) : null } />
{option.type === "timeSlot" ? ( ) : null}
); })}
); }; export default PollHeader;