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