[st] - fix: 지난년도 데이터 가져오기 button confirm 추가
This commit is contained in:
@@ -1,12 +1,21 @@
|
||||
import { Button } from "@common/components";
|
||||
import { useConfirm } from "@frontend-opensource/use-react-hooks";
|
||||
|
||||
interface LastYearDataButtonProps {
|
||||
getLastYearDataFunc: () => void;
|
||||
}
|
||||
|
||||
const LastYearDataButton = ({ getLastYearDataFunc }: LastYearDataButtonProps) => {
|
||||
const { confirm } = useConfirm();
|
||||
|
||||
const handleLastYearDataButton = async () => {
|
||||
if (await confirm('작년 데이터를 불러오시겠습니까?')) {
|
||||
getLastYearDataFunc();
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<Button color="emerald" className="h-[3.2rem] w-[176px]" onClick={getLastYearDataFunc}>
|
||||
<Button color="emerald" className="h-[3.2rem] w-[176px]" onClick={handleLastYearDataButton}>
|
||||
<i className="diveicon di-search" />
|
||||
<span>지난연도 데이터 가져오기</span>
|
||||
</Button>
|
||||
|
||||
Reference in New Issue
Block a user