chore: replace function expression with inline statement
replace destructuring for better static analysis remove unused variables
This commit is contained in:
@@ -44,15 +44,13 @@ async function PointsColumn({
|
||||
title,
|
||||
subtitle,
|
||||
}: PointsColumnProps) {
|
||||
const { formatMessage, formatNumber } = await getIntl()
|
||||
const intl = await getIntl()
|
||||
|
||||
function number() {
|
||||
if (typeof points === "number") {
|
||||
return formatNumber(points)
|
||||
} else if (typeof nights === "number") {
|
||||
return formatNumber(nights)
|
||||
}
|
||||
return "N/A"
|
||||
let number = "N/A"
|
||||
if (typeof points === "number") {
|
||||
number = intl.formatNumber(points)
|
||||
} else if (typeof nights === "number") {
|
||||
number = intl.formatNumber(nights)
|
||||
}
|
||||
|
||||
return (
|
||||
@@ -63,16 +61,16 @@ async function PointsColumn({
|
||||
textAlign="center"
|
||||
className={styles.firstRow}
|
||||
>
|
||||
{formatMessage({
|
||||
{intl.formatMessage({
|
||||
id: title,
|
||||
})}
|
||||
</Body>
|
||||
<Title color="white" level="h2" textAlign="center">
|
||||
{number()}
|
||||
{number}
|
||||
</Title>
|
||||
{subtitle ? (
|
||||
<Body color="white" textAlign="center">
|
||||
{formatMessage({ id: subtitle })}
|
||||
{intl.formatMessage({ id: subtitle })}
|
||||
</Body>
|
||||
) : null}
|
||||
</article>
|
||||
|
||||
Reference in New Issue
Block a user