diff --git a/src/Components/Document/DocumentListPage.js b/src/Components/Document/DocumentListPage.js index 3120e46..981183d 100644 --- a/src/Components/Document/DocumentListPage.js +++ b/src/Components/Document/DocumentListPage.js @@ -171,7 +171,7 @@ const DocumentListPage = ({ perPage }) => { if (!group) { return null; } - + console.log("allDocs", allDocs); const DesktopContent = () => { return ( <> @@ -204,6 +204,7 @@ const DocumentListPage = ({ perPage }) => { parentCaseNumber={doc.parentCaseNumber} parentCaseName={doc.parentCaseName} parentCaseId={doc.parentCaseId} + createdAt={doc.createdAt} docType={doc.docType} documentId={doc.documentId} dateServed={doc.dateServed} diff --git a/src/pageElements/Cards.js b/src/pageElements/Cards.js index 90377e8..965e9f7 100644 --- a/src/pageElements/Cards.js +++ b/src/pageElements/Cards.js @@ -4,7 +4,7 @@ import { FileEarmarkText } from "react-bootstrap-icons"; import TextInput from "../pageElements/TextInput"; import Tooltip from "../pageElements/Tooltip"; import { InfoCircle } from "react-bootstrap-icons"; - +import { toDate } from "firebase/firestore"; export const InfoCard = (props) => { const { data, onEdit, onCancel, onSave, onChangeInput, isEditing, isBusy } = props; @@ -273,15 +273,20 @@ export const DocCard = (props) => { handleNavigate, responseGenerations, confirmDelete, + createdAt, } = props; - + const now = new Date().getTime(); + const uploadedAt = createdAt.toDate(); + const isReportable = Math.round((now - uploadedAt) / 60 / 1000) > 15; + const disabled = docType ? false : true; + const tooltipText = + "Parsing is taking a bit longer than usual. This usually resolves within 15 minutes. If it does not, click “report” and support will address the issue within 24 hours."; + const pendingText = + "Parsing in process, please be patient. This should resolve within 10 minutes."; const report = (documentId, docType) => { console.log("report documentId, docType", documentId, docType); }; - const tooltipText = - "Parsing is taking a bit longer than usual. This usually resolves within 10 - 15 minutes. If it does not, click “report” and support will address the issue within 24 hours."; - const disabled = docType ? false : true; return (
@@ -289,7 +294,13 @@ export const DocCard = (props) => {
- {title} {disabled ? : <>} + {title}{" "} + {disabled && isReportable ? : <>} + {disabled && !isReportable ? ( + + ) : ( + <> + )}
{dateServed ? (
Served: {dateServed}
@@ -299,7 +310,7 @@ export const DocCard = (props) => {
{parentCaseName}
- {disabled ? ( + {disabled && isReportable ? (
); }; + +/* + + {disabled ? ( + isReportable ? ( + + ) : ( + + ) + ) : ( + <> + )} + + */ diff --git a/src/pageElements/Tooltip.js b/src/pageElements/Tooltip.js index ba6aa7c..bd10aa8 100644 --- a/src/pageElements/Tooltip.js +++ b/src/pageElements/Tooltip.js @@ -1,18 +1,23 @@ import { useState } from "react"; import "../styles/tooltip.scss"; -import { InfoCircle } from "react-bootstrap-icons"; +import { InfoCircle, Clock } from "react-bootstrap-icons"; function Tooltip(props) { - const [show, setShow] = useState(false); - const { text } = props; + const [showMessage, setShowMessage] = useState(false); + const { text, iconStyle } = props; + const showClock = iconStyle === "clock"; return (
setShow(true)} - onMouseLeave={() => setShow(false)} + onMouseEnter={() => setShowMessage(true)} + onMouseLeave={() => setShowMessage(false)} > - - {show ? {text} : <>} + {showClock ? ( + + ) : ( + + )} + {showMessage ? {text} : <>}
); }