init
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { X, AlertTriangle } from 'lucide-react';
|
||||
|
||||
interface ConfirmModalProps {
|
||||
@@ -13,12 +14,15 @@ interface ConfirmModalProps {
|
||||
export default function ConfirmModal({
|
||||
title,
|
||||
message,
|
||||
confirmText = 'Подтвердить',
|
||||
cancelText = 'Отмена',
|
||||
confirmText,
|
||||
cancelText,
|
||||
onConfirm,
|
||||
onCancel,
|
||||
variant = 'danger',
|
||||
}: ConfirmModalProps) {
|
||||
const { t } = useTranslation();
|
||||
const defaultConfirmText = confirmText || t('common.confirm');
|
||||
const defaultCancelText = cancelText || t('common.cancel');
|
||||
const getVariantStyles = () => {
|
||||
switch (variant) {
|
||||
case 'danger':
|
||||
@@ -67,13 +71,13 @@ export default function ConfirmModal({
|
||||
onClick={onCancel}
|
||||
className="flex-1 px-6 py-3 bg-gray-200 hover:bg-gray-300 text-gray-700 rounded-2xl transition-all font-semibold"
|
||||
>
|
||||
{cancelText}
|
||||
{defaultCancelText}
|
||||
</button>
|
||||
<button
|
||||
onClick={onConfirm}
|
||||
className={`flex-1 px-6 py-3 text-white rounded-2xl transition-all font-semibold ${styles.confirmButton}`}
|
||||
>
|
||||
{confirmText}
|
||||
{defaultConfirmText}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user