Skip to content

Commit cd28863

Browse files
committed
๐Ÿ”ฅ remove: TableButtons handleModalClick ํ•จ์ˆ˜ ๋ฐ status state ์‚ญ์ œ
1 parent f78ffc6 commit cd28863

File tree

1 file changed

+2
-21
lines changed

1 file changed

+2
-21
lines changed
Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,14 @@
1-
import { useEffect, useState, type MouseEvent } from 'react';
1+
import { useEffect, useState } from 'react';
22
import Button from '../Button';
3-
import TableStatus from './TableStatus';
4-
import { putNoticeApplications } from '@/api/applicationApi';
53

64
interface Props {
75
index: number;
86
click: (dataIndex: number, status: 'accepted' | 'rejected') => void;
97
}
108

119
export default function TableButtons({ index, click }: Props) {
12-
const [status, setStatus] = useState<'pending' | 'accepted' | 'rejected'>(
13-
'pending',
14-
);
1510
const [isMobile, setIsMobile] = useState(window.innerWidth < 768);
1611

17-
const handleModalClick = async () => {
18-
closeModal();
19-
setStatus(modal.status);
20-
try {
21-
await putNoticeApplications(shopId, noticeId, applicaitonId, {
22-
status: modal.status,
23-
});
24-
} catch {
25-
setStatus('pending');
26-
}
27-
};
28-
2912
useEffect(() => {
3013
const handleResize = () => {
3114
setIsMobile(window.innerWidth < 768);
@@ -34,7 +17,7 @@ export default function TableButtons({ index, click }: Props) {
3417
return () => window.removeEventListener('resize', handleResize);
3518
}, []);
3619

37-
return status === 'pending' ? (
20+
return (
3821
<div className="flex gap-8 md:gap-12">
3922
<Button
4023
solid={false}
@@ -59,7 +42,5 @@ export default function TableButtons({ index, click }: Props) {
5942
์Šน์ธํ•˜๊ธฐ
6043
</Button>
6144
</div>
62-
) : (
63-
<TableStatus status={status} />
6445
);
6546
}

0 commit comments

Comments
ย (0)