'use client'; import { useState } from 'react'; import { useTranslation } from '@/lib/i18n'; import { notificationApi } from '@/lib/api'; export default function AdminNotificationsPage() { const { t } = useTranslation(); // Form state const [title, setTitle] = useState(''); const [message, setMessage] = useState(''); const [link, setLink] = useState(''); const [sending, setSending] = useState(false); const [result, setResult] = useState<{ success: boolean; message: string } | null>(null); const handleSendToAll = async (e: React.FormEvent) => { e.preventDefault(); if (!title.trim() || !message.trim()) { setResult({ success: false, message: '제목과 내용을 입력해주세요.' }); return; } setSending(true); setResult(null); try { const response = await notificationApi.adminSendToAll( title.trim(), message.trim(), link.trim() || undefined ); setResult({ success: true, message: response.message }); setTitle(''); setMessage(''); setLink(''); } catch (error) { console.error('Failed to send notification:', error); setResult({ success: false, message: '알림 발송에 실패했습니다.' }); } finally { setSending(false); } }; return (
전체 사용자에게 알림을 보낼 수 있습니다.
차량 추천
사용자 요청에 차량 추천 시
배송 업데이트
배송 상태 변경 시
출금 처리
출금 신청 처리 시
레퍼럴 보상
추천인 보상 적립 시
딜러 승인
딜러 신청 승인/거부 시
공유 판매
공유 차량 판매 시
위 알림은 관련 이벤트 발생 시 자동으로 발송됩니다. 이 페이지에서는 시스템 공지사항을 전체 사용자에게 수동으로 보낼 수 있습니다.