import {useEffect, useState} from "react";
import {pageHjmQuestions} from "@/api/hjm/hjmQuestions";
import {HjmQuestions} from "@/api/hjm/hjmQuestions/model";

/**
 * 文章终极列表
 * @constructor
 */
const Questions = () => {
  const [list, setList] = useState<HjmQuestions[]>([])

  const reload = () => {
    pageHjmQuestions({}).then(res => {
      if (res?.list) {
        setList(res?.list)
      }
    })
  }

  useEffect(() => {
    reload()
  }, [])

  return (
    <div className={'px-3 mb-10'}>
      <div className={'flex flex-col justify-between items-center bg-white rounded-lg p-4'}>
        <div className={'bg-white w-full'}>
          {
            list.map((item, index) => {
              return (
                <div key={index} className={'flex justify-between items-center py-2'}>
                  <div className={'text-sm'}>{item.question}</div>
                </div>
              )
            })
          }
        </div>
      </div>
    </div>
  )
}
export default Questions
