remove unused components
This commit is contained in:
@ -1,72 +0,0 @@
|
||||
import { useEffect, useState } from 'react'
|
||||
import { useBoilers } from '../hooks/swrHooks'
|
||||
import CustomTable from '../components/CustomTable'
|
||||
import { Text } from '@fluentui/react-components'
|
||||
|
||||
function Boilers() {
|
||||
const [boilersPage, setBoilersPage] = useState(1)
|
||||
const [boilerSearch, setBoilerSearch] = useState("")
|
||||
const [debouncedBoilerSearch, setDebouncedBoilerSearch] = useState("")
|
||||
const { boilers } = useBoilers(10, boilersPage, debouncedBoilerSearch)
|
||||
|
||||
useEffect(() => {
|
||||
const handler = setTimeout(() => {
|
||||
setDebouncedBoilerSearch(boilerSearch)
|
||||
}, 500)
|
||||
|
||||
return () => {
|
||||
clearTimeout(handler)
|
||||
}
|
||||
}, [boilerSearch])
|
||||
|
||||
useEffect(() => {
|
||||
setBoilersPage(1)
|
||||
setBoilerSearch("")
|
||||
}, [])
|
||||
|
||||
return (
|
||||
<div style={{
|
||||
display: 'flex',
|
||||
flexDirection: 'column',
|
||||
padding: '1rem',
|
||||
width: '100%',
|
||||
gap: '1rem'
|
||||
}}>
|
||||
<Text size={600} weight='bold'>
|
||||
Котельные
|
||||
</Text>
|
||||
|
||||
{boilers &&
|
||||
<CustomTable data={boilers} columns={[
|
||||
{
|
||||
name: 'id_object',
|
||||
header: 'ID',
|
||||
type: 'string'
|
||||
},
|
||||
{
|
||||
name: 'boiler_name',
|
||||
header: 'Название',
|
||||
type: 'string'
|
||||
},
|
||||
{
|
||||
name: 'boiler_code',
|
||||
header: 'Код',
|
||||
type: 'string'
|
||||
},
|
||||
{
|
||||
name: 'id_city',
|
||||
header: 'Город',
|
||||
type: 'dictionary'
|
||||
},
|
||||
{
|
||||
name: 'activity',
|
||||
header: 'Активен',
|
||||
type: 'boolean'
|
||||
},
|
||||
]} />
|
||||
}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default Boilers
|
||||
@ -1,11 +0,0 @@
|
||||
import ServerHardware from '../components/ServerHardware'
|
||||
|
||||
const ComponentTest = () => {
|
||||
return (
|
||||
<div style={{ display: 'flex', flexDirection: 'column', alignItems: 'flex-start', gap: '1rem', padding: '1rem' }}>
|
||||
<ServerHardware />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default ComponentTest
|
||||
Reference in New Issue
Block a user