39 lines
1.1 KiB
JavaScript
39 lines
1.1 KiB
JavaScript
import React from "react"
|
|
// import {
|
|
// Box,List,ListItem
|
|
// } from "@chakra-ui/react"
|
|
import {
|
|
get_article
|
|
} from '../api'
|
|
import {useLocalStorage} from "../hooks";
|
|
export const Faq = () => {
|
|
const [faq, setFaq] = React.useState({title: "", content: ""})
|
|
const [sel] = useLocalStorage('lang', 'en')
|
|
|
|
React.useEffect(() => {
|
|
get_article({lang:sel,type:"faq"}).then(res=>{
|
|
if (res.data.code === 0) {
|
|
setFaq(res.data.data)
|
|
}
|
|
}).catch(c=>{
|
|
console.error(c)
|
|
})
|
|
},[])
|
|
|
|
// const elementRef = React.useRef()
|
|
// const rateList = [
|
|
// {from: "0", to: "5000", rate: "1.6%"},
|
|
// {from: "5001", to: "30000", rate: "2.2%"},
|
|
// {from: "30001", to: "80000", rate: "2.8%"},
|
|
// {from: "80001", to: "150000", rate: "3.5%"},
|
|
// {from: "150001", to: "200000", rate: "4.2%"},
|
|
// {from: "200000", to: "500000", rate: "5%"},
|
|
// ]
|
|
return (
|
|
<div>
|
|
<div>{faq.title}</div>
|
|
<div dangerouslySetInnerHTML={{__html:faq.content}}></div>
|
|
</div>
|
|
)
|
|
}
|