메인 공지사항 faq 없을 때 처리
This commit is contained in:
parent
a1aec03d12
commit
3f966da81f
@ -11,11 +11,13 @@ import { useRouter } from 'next/navigation'
|
||||
import { globalLocaleStore } from '@/store/localeAtom'
|
||||
import { queryStringFormatter } from '@/util/common-utils'
|
||||
import MainSkeleton from '../ui/MainSkeleton'
|
||||
import { SessionContext } from '@/app/SessionProvider'
|
||||
import { useMainContentsController } from '@/hooks/main/useMainContentsController'
|
||||
import { QcastContext } from '@/app/QcastProvider'
|
||||
import { useSwal } from '@/hooks/useSwal'
|
||||
|
||||
export default function MainContents() {
|
||||
const { swalFire } = useSwal()
|
||||
|
||||
const { getMessage } = useMessage()
|
||||
const router = useRouter()
|
||||
const globalLocaleState = useRecoilValue(globalLocaleStore)
|
||||
@ -125,62 +127,50 @@ export default function MainContents() {
|
||||
)}
|
||||
</ProductItem>
|
||||
<ProductItem num={2} name={getMessage('main.content.notice')}>
|
||||
<div className="notice-box">
|
||||
{recentNoticeList.length > 0 ? (
|
||||
<>
|
||||
<div className="notice-day pre">{dayjs(recentNoticeList[0]?.regDt).format('YYYY.MM.DD')}</div>
|
||||
<div className="notice-title">{recentNoticeList[0]?.title}</div>
|
||||
<div
|
||||
className="notice-contents"
|
||||
dangerouslySetInnerHTML={{ __html: recentNoticeList[0]?.contents ? recentNoticeList[0].contents.replaceAll('\n', '<br/>') : '' }}
|
||||
></div>
|
||||
</>
|
||||
) : (
|
||||
<MainSkeleton count={5} />
|
||||
)}
|
||||
</div>
|
||||
{recentNoticeList.length > 0 ? (
|
||||
<div className="notice-box">
|
||||
<div className="notice-day pre">{dayjs(recentNoticeList[0]?.regDt).format('YYYY.MM.DD')}</div>
|
||||
<div className="notice-title">{recentNoticeList[0]?.title}</div>
|
||||
<div
|
||||
className="notice-contents"
|
||||
dangerouslySetInnerHTML={{ __html: recentNoticeList[0]?.contents ? recentNoticeList[0].contents.replaceAll('\n', '<br/>') : '' }}
|
||||
></div>
|
||||
</div>
|
||||
) : (
|
||||
<div className="recently-no-data">
|
||||
<h3>{getMessage('main.content.noBusiness')}</h3>
|
||||
</div>
|
||||
)}
|
||||
</ProductItem>
|
||||
</div>
|
||||
<div className="main-product-list">
|
||||
<ProductItem num={3} name={getMessage('main.faq')}>
|
||||
<ul className="faq-list">
|
||||
{recentFaqList.length > 0 ? (
|
||||
<>
|
||||
{recentFaqList.map((row) => {
|
||||
return (
|
||||
<li key={row.rowNumber} className="faq-item">
|
||||
<div className="faq-item-inner">
|
||||
<div className="faq-num pre">FAQ {row.totCnt - row.rowNumber}</div>
|
||||
<div className="faq-title pre">{row.title}</div>
|
||||
<div className="faq-day pre">{dayjs(row.regDt).format('YYYY.MM.DD')}</div>
|
||||
</div>
|
||||
</li>
|
||||
)
|
||||
})}
|
||||
</>
|
||||
) : (
|
||||
<MainSkeleton count={2} />
|
||||
)}
|
||||
</ul>
|
||||
{recentFaqList.length > 0 ? (
|
||||
<ul className="faq-list">
|
||||
{recentFaqList.map((row) => {
|
||||
return (
|
||||
<li key={row.rowNumber} className="faq-item">
|
||||
<div className="faq-item-inner">
|
||||
<div className="faq-num pre">FAQ {row.totCnt - row.rowNumber}</div>
|
||||
<div className="faq-title pre">{row.title}</div>
|
||||
<div className="faq-day pre">{dayjs(row.regDt).format('YYYY.MM.DD')}</div>
|
||||
</div>
|
||||
</li>
|
||||
)
|
||||
})}
|
||||
</ul>
|
||||
) : (
|
||||
<div className="recently-no-data">
|
||||
<h3>{getMessage('main.content.noBusiness')}</h3>
|
||||
</div>
|
||||
)}
|
||||
</ProductItem>
|
||||
<ProductItem num={4} name={'Data Download'}>
|
||||
<div className="data-download-wrap">
|
||||
<button
|
||||
className="data-down"
|
||||
type="button"
|
||||
onClick={() => {
|
||||
return alert(getMessage('main.content.alert.noFile'))
|
||||
}}
|
||||
>
|
||||
<button className="data-down" type="button" onClick={() => swalFire({ text: getMessage('main.content.alert.noFile'), type: 'alert' })}>
|
||||
<span>{getMessage('main.content.download1')}</span>
|
||||
</button>
|
||||
<button
|
||||
className="data-down"
|
||||
type="button"
|
||||
onClick={() => {
|
||||
return alert(getMessage('main.content.alert.noFile'))
|
||||
}}
|
||||
>
|
||||
<button className="data-down" type="button" onClick={() => swalFire({ text: getMessage('main.content.alert.noFile'), type: 'alert' })}>
|
||||
<span>{getMessage('main.content.download2')}</span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user