import { useTranslation } from 'react-i18next'; import { Button, Card, Col, Empty, Input, InputNumber, Row, Select, Space } from 'antd'; import { ArrowDownOutlined, ArrowUpOutlined, DeleteOutlined, PlusOutlined } from '@ant-design/icons'; import type { FallbackRow } from '@/schemas/forms/inbound-form'; interface FallbacksCardProps { fallbacks: FallbackRow[]; fallbackChildOptions: { label: string; value: number }[]; addFallback: () => void; updateFallback: (rowKey: string, patch: Partial) => void; removeFallback: (idx: number) => void; moveFallback: (idx: number, direction: -1 | 1) => void; addAllFallbacks: () => void; } export default function FallbacksCard({ fallbacks, fallbackChildOptions, addFallback, updateFallback, removeFallback, moveFallback, addAllFallbacks, }: FallbacksCardProps) { const { t } = useTranslation(); const addButtons = ( ); return ( {fallbacks.length === 0 ? ( ) : ( fallbacks.map((record, idx) => ( updateFallback(record.rowKey, { name: e.target.value })} /> updateFallback(record.rowKey, { alpn: e.target.value })} /> updateFallback(record.rowKey, { path: e.target.value })} /> updateFallback(record.rowKey, { dest: e.target.value })} /> updateFallback(record.rowKey, { xver: Number(v) || 0 })} /> )) )} ); }