File name
Commit message
Commit date
File name
Commit message
Commit date
File name
Commit message
Commit date
File name
Commit message
Commit date
File name
Commit message
Commit date
File name
Commit message
Commit date
File name
Commit message
Commit date
'use client';
import { useState } from 'react';
import { FoxIconButton } from '@fox/core/components/fox-icon-button';
import { useFeedback } from '@/app/_hooks/use-feedback';
import type { Merchant } from '@/lib/domain/merchant';
import { MerchantFormModal } from './merchant-form-modal';
interface MerchantRowActionsProps {
merchant: Merchant;
}
/**
* 수정은 모달을 열어 등록된 내용을 보여 준다 — 백엔드에 수정 API가 없어 모달이 조회
* 전용으로 뜬다(`merchant-form-modal.tsx`의 `IS_EDIT_ENABLED`). API가 생기면 그 한 줄만
* 바꾸면 여기는 손대지 않아도 된다.
*
* TODO(백엔드): 삭제 API도 없다(`/api/v1/mngr/voc`는 목록·등록뿐). 시안의 자리는 두되
* 눌러도 할 수 있는 일이 없어 사유를 알린다.
*/
export function MerchantRowActions({ merchant }: MerchantRowActionsProps) {
const { showToast } = useFeedback();
const [isDetailOpen, setIsDetailOpen] = useState(false);
return (
<span aria-label={`${merchant.name} 관리`}>
<FoxIconButton
type="default"
size="sm"
icon={<i className="fox-ico fox-ico-PencilSimple" aria-hidden="true" />}
label="수정"
onAction={() => setIsDetailOpen(true)}
/>
<FoxIconButton
type="default"
size="sm"
icon={<i className="fox-ico fox-ico-Trash" aria-hidden="true" />}
label="삭제"
onAction={() =>
showToast({
variant: 'warning',
message: '가맹점 삭제 기능은 백엔드 준비 중입니다.',
})
}
/>
{isDetailOpen && (
<MerchantFormModal
merchant={merchant}
onClose={() => setIsDetailOpen(false)}
/>
)}
</span>
);
}