chore: remove destructuring of intl.formatMessage

This commit is contained in:
Arvid Norlin
2024-08-14 09:39:26 +02:00
parent 6f293be3a7
commit 6c15f1ae3a
3 changed files with 17 additions and 14 deletions

View File

@@ -18,7 +18,7 @@ export default function MobileTable({
showMore,
hasMore,
}: TablePropsPagination) {
const { formatMessage } = useIntl()
const intl = useIntl()
return (
<div className={styles.container}>
@@ -27,11 +27,13 @@ export default function MobileTable({
<tr>
<Body asChild>
<th className={styles.th}>
{formatMessage({ id: "Transactions" })}
{intl.formatMessage({ id: "Transactions" })}
</th>
</Body>
<Body asChild>
<th className={styles.th}>{formatMessage({ id: "Points" })}</th>
<th className={styles.th}>
{intl.formatMessage({ id: "Points" })}
</th>
</Body>
</tr>
</thead>
@@ -52,7 +54,7 @@ export default function MobileTable({
<span>{`${transaction.hotelName}, ${transaction.city}`}</span>
) : null}
<span>
{`${transaction.nights} ${formatMessage({ id: transaction.nights === 1 ? "night" : "nights" })}`}
{`${transaction.nights} ${intl.formatMessage({ id: transaction.nights === 1 ? "night" : "nights" })}`}
</span>
</td>
<AwardPoints awardPoints={transaction.awardPoints} />
@@ -61,7 +63,9 @@ export default function MobileTable({
) : (
<tr>
<td className={styles.placeholder} colSpan={2}>
{formatMessage({ id: "There are no transactions to display" })}
{intl.formatMessage({
id: "There are no transactions to display",
})}
</td>
</tr>
)}
@@ -76,7 +80,7 @@ export default function MobileTable({
}}
>
<ChevronDownIcon height={24} width={24} />
{formatMessage({ id: "Show more" })}
{intl.formatMessage({ id: "Show more" })}
</button>
) : null}
</div>