import React from "react"; import { shiftDays, shiftMonths, formatISO, nowForSite, parseUTCDate, isBefore, isAfter, } from "./date"; import { QueryButton } from "./query"; function renderArrow(query, site, period, prevDate, nextDate) { const insertionDate = parseUTCDate(site.insertedAt); const disabledLeft = isBefore( parseUTCDate(prevDate), insertionDate, period ); const disabledRight = isAfter( parseUTCDate(nextDate), nowForSite(site), period ); const leftClasses = `flex items-center px-2 border-r border-gray-300 rounded-l dark:border-gray-500 dark:text-gray-100 ${ disabledLeft ? "bg-gray-300 dark:bg-gray-950" : "hover:bg-gray-100 dark:hover:bg-gray-900" }`; const rightClasses = `flex items-center px-2 rounded-r dark:text-gray-100 ${ disabledRight ? "bg-gray-300 dark:bg-gray-950" : "hover:bg-gray-100 dark:hover:bg-gray-900" }`; return (