import React, { useState, useEffect } from 'react'; import { Link, useLocation } from 'react-router-dom'; import Switch from '@mui/material/Switch'; import * as EgovNet from 'api/egovFetch'; import URL from 'constants/url'; import { default as EgovLeftNav } from 'components/leftmenu/EgovLeftNavAdmin'; import EgovPagingPaginationInfo from 'components/EgovPagingPaginationInfo'; import styled from "styled-components"; const StyledDiv = styled.div` .board_btn_area { margin: 12px 0px; } `; const label = { inputProps: { 'aria-label': '사용여부' } }; function PopUp(props) { const location = useLocation(); const [listPopup, setListPopup] = useState([]); const [searchCondition, setSearchCondition] = useState(location.state?.searchCondition || { pageIndex: 1, searchCnd: '0', searchWrd: '' }); const [paginationInfo, setPaginationInfo] = useState({}); useEffect(function () { getList(searchCondition); // eslint-disable-next-line react-hooks/exhaustive-deps }, []); const requestOptions = { method: "GET", headers: { 'Content-type': 'application/json' } } const getList = (searchCondition) => { EgovNet.requestFetch(`/contents/api/popup-manage/list?page=${searchCondition.pageIndex-1}&size=10&sort=popupSeq,desc`, requestOptions, function (resp) { console.log('%o', resp); setListPopup(resp.result.listPopup); setPaginationInfo({...resp.result.paginationInfo}); } ); } const Location = React.memo(function Location() { return (
검색된 결과가 없습니다.
} {listPopup.map((it)=>(