11import { useEffect , useState } from 'react'
2- import { useNavigate } from 'react-router-dom'
32import { useSelector } from 'react-redux'
3+ import { useNavigate } from 'react-router-dom'
44
55// material-ui
6- import { Chip , Box , Stack , ToggleButton , ToggleButtonGroup , IconButton } from '@mui/material'
6+ import { Box , Chip , IconButton , Stack , ToggleButton , ToggleButtonGroup } from '@mui/material'
77import { useTheme } from '@mui/material/styles'
88
99// project imports
10- import MainCard from '@/ui-component/cards/MainCard'
11- import ItemCard from '@/ui-component/cards/ItemCard'
12- import { gridSpacing } from '@/store/constant'
1310import AgentsEmptySVG from '@/assets/images/agents_empty.svg'
14- import ConfirmDialog from '@/ui-component/dialog/ConfirmDialog'
15- import { FlowListTable } from '@/ui-component/table/FlowListTable'
16- import ViewHeader from '@/layout/MainLayout/ViewHeader'
1711import ErrorBoundary from '@/ErrorBoundary'
12+ import ViewHeader from '@/layout/MainLayout/ViewHeader'
13+ import { gridSpacing } from '@/store/constant'
1814import { StyledPermissionButton } from '@/ui-component/button/RBACButtons'
15+ import ItemCard from '@/ui-component/cards/ItemCard'
16+ import MainCard from '@/ui-component/cards/MainCard'
17+ import ConfirmDialog from '@/ui-component/dialog/ConfirmDialog'
1918import TablePagination , { DEFAULT_ITEMS_PER_PAGE } from '@/ui-component/pagination/TablePagination'
19+ import { FlowListTable } from '@/ui-component/table/FlowListTable'
2020
2121// API
2222import chatflowsApi from '@/api/chatflows'
@@ -25,11 +25,11 @@ import chatflowsApi from '@/api/chatflows'
2525import useApi from '@/hooks/useApi'
2626
2727// const
28- import { baseURL , AGENTFLOW_ICONS } from '@/store/constant'
28+ import { AGENTFLOW_ICONS , baseURL } from '@/store/constant'
2929import { useError } from '@/store/context/ErrorContext'
3030
3131// icons
32- import { IconPlus , IconLayoutGrid , IconList , IconX , IconAlertTriangle } from '@tabler/icons-react'
32+ import { IconAlertTriangle , IconLayoutGrid , IconList , IconPlus , IconX } from '@tabler/icons-react'
3333
3434// ==============================|| AGENTS ||============================== //
3535
@@ -45,18 +45,19 @@ const Agentflows = () => {
4545 const { error, setError } = useError ( )
4646
4747 const getAllAgentflows = useApi ( chatflowsApi . getAllAgentflows )
48- const [ view , setView ] = useState ( localStorage . getItem ( 'flowDisplayStyle ' ) || 'card' )
48+ const [ view , setView ] = useState ( localStorage . getItem ( 'agentFlowDisplayStyle ' ) || 'card' )
4949 const [ agentflowVersion , setAgentflowVersion ] = useState ( localStorage . getItem ( 'agentFlowVersion' ) || 'v2' )
5050 const [ showDeprecationNotice , setShowDeprecationNotice ] = useState ( true )
5151
5252 /* Table Pagination */
5353 const [ currentPage , setCurrentPage ] = useState ( 1 )
54- const [ pageLimit , setPageLimit ] = useState ( DEFAULT_ITEMS_PER_PAGE )
54+ const [ pageLimit , setPageLimit ] = useState ( ( ) => Number ( localStorage . getItem ( 'agentFlowPageSize' ) || DEFAULT_ITEMS_PER_PAGE ) )
5555 const [ total , setTotal ] = useState ( 0 )
5656
5757 const onChange = ( page , pageLimit ) => {
5858 setCurrentPage ( page )
5959 setPageLimit ( pageLimit )
60+ localStorage . setItem ( 'agentFlowPageSize' , pageLimit )
6061 refresh ( page , pageLimit , agentflowVersion )
6162 }
6263
@@ -70,7 +71,7 @@ const Agentflows = () => {
7071
7172 const handleChange = ( event , nextView ) => {
7273 if ( nextView === null ) return
73- localStorage . setItem ( 'flowDisplayStyle ' , nextView )
74+ localStorage . setItem ( 'agentFlowDisplayStyle ' , nextView )
7475 setView ( nextView )
7576 }
7677
0 commit comments