Skip to content

Commit

Permalink
rename formatter function name
Browse files Browse the repository at this point in the history
  • Loading branch information
alisher-epam committed Dec 22, 2023
1 parent c1c21da commit 639b011
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,18 @@ export const DonorsVersionView = ({ version }) => {
return donorIds.flat();
}, [versionContext?.changes]);

const renderKeyValueComponent = useCallback(({ value, id, asLink = false }) => {
const getFormattedValue = useCallback(({ value, id, asLink = false }) => {
const content = asLink ? <TextLink to={getDonorUrl(id)}>{value}</TextLink> : value;
const isUpdated = changedDonorIds?.includes(id);

const displayValue = isUpdated ? <mark>{content}</mark> : content;
const formattedValue = isUpdated ? <mark>{content}</mark> : content;

return displayValue;
return formattedValue;
}, [changedDonorIds]);

const formatter = {
name: ({ name, id }) => renderKeyValueComponent({ value: name, id, asLink: true }),
code: ({ code, id }) => renderKeyValueComponent({ value: code, id }),
name: ({ name, id }) => getFormattedValue({ value: name, id, asLink: true }),
code: ({ code, id }) => getFormattedValue({ value: code, id }),
};

return (
Expand Down

0 comments on commit 639b011

Please sign in to comment.