fix: import ReactNode, Dispatch, SetStateAction explicitly (React namespace not in scope)
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
|
import { ReactNode } from 'react'
|
||||||
import Table from '@mui/material/Table'
|
import Table from '@mui/material/Table'
|
||||||
import TableBody from '@mui/material/TableBody'
|
import TableBody from '@mui/material/TableBody'
|
||||||
import TableCell from '@mui/material/TableCell'
|
import TableCell from '@mui/material/TableCell'
|
||||||
@@ -13,7 +14,7 @@ import Typography from '@mui/material/Typography'
|
|||||||
export interface Column<T> {
|
export interface Column<T> {
|
||||||
key: keyof T
|
key: keyof T
|
||||||
label: string
|
label: string
|
||||||
render?: (row: T) => React.ReactNode
|
render?: (row: T) => ReactNode
|
||||||
}
|
}
|
||||||
|
|
||||||
interface Props<T extends { id: number }> {
|
interface Props<T extends { id: number }> {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { useState, useEffect } from 'react'
|
import { useState, useEffect, Dispatch, SetStateAction } from 'react'
|
||||||
import { useParams, Link } from 'react-router-dom'
|
import { useParams, Link } from 'react-router-dom'
|
||||||
import Layout from '../components/Layout'
|
import Layout from '../components/Layout'
|
||||||
import DataTable, { Column } from '../components/DataTable'
|
import DataTable, { Column } from '../components/DataTable'
|
||||||
@@ -54,7 +54,7 @@ export default function ConfigDetail() {
|
|||||||
{
|
{
|
||||||
label: 'Zones',
|
label: 'Zones',
|
||||||
rows: zones as AnyEntity[],
|
rows: zones as AnyEntity[],
|
||||||
setRows: setZones as React.Dispatch<React.SetStateAction<AnyEntity[]>>,
|
setRows: setZones as Dispatch<SetStateAction<AnyEntity[]>>,
|
||||||
api: zonesApi,
|
api: zonesApi,
|
||||||
columns: [
|
columns: [
|
||||||
{ key: 'name' as const, label: 'Name' },
|
{ key: 'name' as const, label: 'Name' },
|
||||||
@@ -70,7 +70,7 @@ export default function ConfigDetail() {
|
|||||||
{
|
{
|
||||||
label: 'Interfaces',
|
label: 'Interfaces',
|
||||||
rows: interfaces as AnyEntity[],
|
rows: interfaces as AnyEntity[],
|
||||||
setRows: setInterfaces as React.Dispatch<React.SetStateAction<AnyEntity[]>>,
|
setRows: setInterfaces as Dispatch<SetStateAction<AnyEntity[]>>,
|
||||||
api: interfacesApi,
|
api: interfacesApi,
|
||||||
columns: [
|
columns: [
|
||||||
{ key: 'name' as const, label: 'Interface' },
|
{ key: 'name' as const, label: 'Interface' },
|
||||||
@@ -90,7 +90,7 @@ export default function ConfigDetail() {
|
|||||||
{
|
{
|
||||||
label: 'Policies',
|
label: 'Policies',
|
||||||
rows: policies as AnyEntity[],
|
rows: policies as AnyEntity[],
|
||||||
setRows: setPolicies as React.Dispatch<React.SetStateAction<AnyEntity[]>>,
|
setRows: setPolicies as Dispatch<SetStateAction<AnyEntity[]>>,
|
||||||
api: policiesApi,
|
api: policiesApi,
|
||||||
columns: [
|
columns: [
|
||||||
{
|
{
|
||||||
@@ -119,7 +119,7 @@ export default function ConfigDetail() {
|
|||||||
{
|
{
|
||||||
label: 'Rules',
|
label: 'Rules',
|
||||||
rows: rules as AnyEntity[],
|
rows: rules as AnyEntity[],
|
||||||
setRows: setRules as React.Dispatch<React.SetStateAction<AnyEntity[]>>,
|
setRows: setRules as Dispatch<SetStateAction<AnyEntity[]>>,
|
||||||
api: rulesApi,
|
api: rulesApi,
|
||||||
columns: [
|
columns: [
|
||||||
{ key: 'action' as const, label: 'Action' },
|
{ key: 'action' as const, label: 'Action' },
|
||||||
@@ -153,7 +153,7 @@ export default function ConfigDetail() {
|
|||||||
{
|
{
|
||||||
label: 'Masq/NAT',
|
label: 'Masq/NAT',
|
||||||
rows: masq as AnyEntity[],
|
rows: masq as AnyEntity[],
|
||||||
setRows: setMasq as React.Dispatch<React.SetStateAction<AnyEntity[]>>,
|
setRows: setMasq as Dispatch<SetStateAction<AnyEntity[]>>,
|
||||||
api: masqApi,
|
api: masqApi,
|
||||||
columns: [
|
columns: [
|
||||||
{ key: 'out_interface' as const, label: 'Out Interface' },
|
{ key: 'out_interface' as const, label: 'Out Interface' },
|
||||||
|
|||||||
Reference in New Issue
Block a user