fix(i18n): prepare for Lokalise
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
"use client"
|
||||
|
||||
import { useState } from "react"
|
||||
import { useIntl } from "react-intl"
|
||||
|
||||
import JsonToHtml from "@/components/JsonToHtml"
|
||||
import SectionContainer from "@/components/Section/Container"
|
||||
@@ -14,6 +16,8 @@ import type { AccordionProps } from "@/types/components/blocks/Accordion"
|
||||
import { HotelHashValues } from "@/types/components/hotelPage/tabNavigation"
|
||||
|
||||
export default function AccordionSection({ accordion, title }: AccordionProps) {
|
||||
const intl = useIntl()
|
||||
|
||||
const showToggleButton = accordion.length > 5
|
||||
const [allAccordionsVisible, setAllAccordionsVisible] =
|
||||
useState(!showToggleButton)
|
||||
@@ -44,8 +48,12 @@ export default function AccordionSection({ accordion, title }: AccordionProps) {
|
||||
<ShowMoreButton
|
||||
loadMoreData={toggleAccordions}
|
||||
showLess={allAccordionsVisible}
|
||||
textShowMore="See all FAQ"
|
||||
textShowLess="See less FAQ"
|
||||
textShowMore={intl.formatMessage({
|
||||
id: "See all FAQ",
|
||||
})}
|
||||
textShowLess={intl.formatMessage({
|
||||
id: "See less FAQ",
|
||||
})}
|
||||
/>
|
||||
) : null}
|
||||
</SectionContainer>
|
||||
|
||||
Reference in New Issue
Block a user