Skip to content

Commit

Permalink
👌 - fix: pr fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Xaohs committed Sep 27, 2024
1 parent 8d83506 commit 53f48ba
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ export const ProcessingStatusBadge: React.FC<ProcessingStatusBadgeProps> = ({

const getStatusText = () => {
if (processingStatus === "new" && plannedDestructionDate) {
const isPlannedDestructionDateInPast =
new Date(plannedDestructionDate) < new Date();
if (isPlannedDestructionDateInPast) {
return `Wordt vernietigd`;
}
return `Wordt vernietigd ${timeAgo(plannedDestructionDate, { shortFormat: true })}`;
}
return field2Title(PROCESSING_STATUS_MAPPING[processingStatus], {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,7 @@ export function DestructionListDetailPage() {
};

const validateDestroy = ({ name }: AttributeData) => {
// Name can be undefined at a certain point and will crash the entire page
if (
(name as string | undefined)?.toLowerCase() ===
destructionList.name.toLowerCase()
Expand Down

0 comments on commit 53f48ba

Please sign in to comment.