Fix regulators page: add missing Select import and improve error handling
This commit is contained in:
parent
3b8d130cbd
commit
0236c927e7
@ -4,6 +4,7 @@ import { NaturalRegulator } from '@/types'
|
||||
import Card from '@/components/base/Card'
|
||||
import Button from '@/components/base/Button'
|
||||
import Input from '@/components/base/Input'
|
||||
import Select from '@/components/base/Select'
|
||||
import Table from '@/components/base/Table'
|
||||
import { validateRequired, validateNumber } from '@/utils/validators'
|
||||
import './RegulatorsConfigurationPage.css'
|
||||
@ -24,7 +25,7 @@ export default function RegulatorsConfigurationPage() {
|
||||
})
|
||||
const [errors, setErrors] = useState<Record<string, string>>({})
|
||||
|
||||
if (loading || !data) {
|
||||
if (loading) {
|
||||
return (
|
||||
<div className="regulators-config-page">
|
||||
<div className="page-loading">Loading...</div>
|
||||
@ -33,7 +34,7 @@ export default function RegulatorsConfigurationPage() {
|
||||
}
|
||||
|
||||
// Safely normalize regulators to ensure all required fields exist
|
||||
const regulators: NaturalRegulator[] = (data.regulators || [])
|
||||
const regulators: NaturalRegulator[] = (data?.regulators || [])
|
||||
.filter(reg => reg && reg.id && reg.name) // Filter out invalid entries
|
||||
.map(reg => ({
|
||||
id: reg.id,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user