MSP-3205 add ErrorConfigModal
This commit is contained in:
1 parent
c6e815bc8e
commit
546db2cabf
1 file changed
+40
@@ -0,0 +1,40 @@
|
||||
import Modal from '@widgets/Modal'
|
||||
import { ModalPropsType } from '@widgets/Modal/modal.type.ts'
|
||||
import { FC } from 'react'
|
||||
import { Table } from 'antd'
|
||||
|
||||
interface ErrorConfigModalProps
|
||||
extends Omit<ModalPropsType, 'title' | 'children'> {
|
||||
details?: { [key: string]: string }
|
||||
}
|
||||
|
||||
const ErrorConfigModal: FC<ErrorConfigModalProps> = ({ details = {}, onClose, open }) => {
|
||||
|
||||
const columns = [
|
||||
{
|
||||
dataIndex: 'key',
|
||||
key: 'key',
|
||||
render: (text: string) => <span style={{ color: 'red' }}>{text}</span>
|
||||
},
|
||||
{
|
||||
dataIndex: 'value',
|
||||
key: 'value'
|
||||
}
|
||||
]
|
||||
|
||||
const data = Object.keys(details).map((key) => ({
|
||||
key,
|
||||
value: details[key]
|
||||
}))
|
||||
|
||||
return (
|
||||
<Modal title="Несоотвествия схемы конфигурации" open={open}
|
||||
onClose={onClose}>
|
||||
<div>
|
||||
<Table columns={columns} dataSource={data} showHeader={false} pagination={false} />
|
||||
</div>
|
||||
</Modal>
|
||||
)
|
||||
}
|
||||
|
||||
export default ErrorConfigModal
|
||||
Reference in new issue
Block a user