condition checks in rental history in profile
This commit is contained in:
@@ -9,10 +9,10 @@ interface ConditionCheckViewerModalProps {
|
||||
}
|
||||
|
||||
const checkTypeLabels: Record<string, string> = {
|
||||
pre_rental_owner: "Pre-Rental Check (Owner)",
|
||||
rental_start_renter: "Rental Start Check (Renter)",
|
||||
rental_end_renter: "Rental End Check (Renter)",
|
||||
post_rental_owner: "Post-Rental Check (Owner)",
|
||||
pre_rental_owner: "Pre-Rental Condition (Owner)",
|
||||
rental_start_renter: "Rental Start Condition (Renter)",
|
||||
rental_end_renter: "Rental End Condition (Renter)",
|
||||
post_rental_owner: "Post-Rental Condition (Owner)",
|
||||
};
|
||||
|
||||
const ConditionCheckViewerModal: React.FC<ConditionCheckViewerModalProps> = ({
|
||||
@@ -65,10 +65,13 @@ const ConditionCheckViewerModal: React.FC<ConditionCheckViewerModalProps> = ({
|
||||
? `${conditionCheck.submittedByUser.firstName} ${conditionCheck.submittedByUser.lastName}`
|
||||
: "Unknown";
|
||||
|
||||
const submittedDate = new Date(conditionCheck.submittedAt).toLocaleString(undefined, {
|
||||
dateStyle: "short",
|
||||
timeStyle: "short",
|
||||
});
|
||||
const submittedDate = new Date(conditionCheck.submittedAt).toLocaleString(
|
||||
undefined,
|
||||
{
|
||||
dateStyle: "short",
|
||||
timeStyle: "short",
|
||||
}
|
||||
);
|
||||
|
||||
// Filter to only valid string keys for display
|
||||
const validImageKeys = (conditionCheck.imageFilenames || []).filter(
|
||||
@@ -76,7 +79,9 @@ const ConditionCheckViewerModal: React.FC<ConditionCheckViewerModalProps> = ({
|
||||
);
|
||||
|
||||
const currentImageKey = validImageKeys[selectedImage];
|
||||
const currentImageUrl = currentImageKey ? imageUrls.get(currentImageKey) : undefined;
|
||||
const currentImageUrl = currentImageKey
|
||||
? imageUrls.get(currentImageKey)
|
||||
: undefined;
|
||||
|
||||
return (
|
||||
<div
|
||||
@@ -219,7 +224,11 @@ const ConditionCheckViewerModal: React.FC<ConditionCheckViewerModalProps> = ({
|
||||
</div>
|
||||
|
||||
<div className="modal-footer">
|
||||
<button type="button" className="btn btn-secondary" onClick={onHide}>
|
||||
<button
|
||||
type="button"
|
||||
className="btn btn-secondary"
|
||||
onClick={onHide}
|
||||
>
|
||||
Close
|
||||
</button>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user