Skip to content

Commit

Permalink
♻️ refactor: refactor settings page entry
Browse files Browse the repository at this point in the history
  • Loading branch information
arvinxx committed Oct 6, 2023
1 parent c4bdd62 commit e86aff2
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 76 deletions.
21 changes: 0 additions & 21 deletions src/app/settings/agent/index.tsx

This file was deleted.

24 changes: 19 additions & 5 deletions src/app/settings/agent/page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,21 @@
import Page from './index';
'use client';

const Index = () => {
return <Page />;
};
import { memo } from 'react';

export default Index;
import { useSwitchSideBarOnInit } from '@/store/global/hooks/useSwitchSettingsOnInit';
import { SettingsTabs } from '@/store/global/initialState';

import Layout from '../index';
import Agent from './Agent';

const AgentSetting = memo(() => {
useSwitchSideBarOnInit(SettingsTabs.Agent);

return (
<Layout>
<Agent />
</Layout>
);
});

export default AgentSetting;
20 changes: 0 additions & 20 deletions src/app/settings/common/index.tsx

This file was deleted.

23 changes: 18 additions & 5 deletions src/app/settings/common/page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,20 @@
import Page from './index';
'use client';

const Index = () => {
return <Page />;
};
import { memo } from 'react';

export default Index;
import { useSwitchSideBarOnInit } from '@/store/global/hooks/useSwitchSettingsOnInit';
import { SettingsTabs } from '@/store/global/initialState';

import Layout from '../index';
import Common from './Common';

const CommonSetting = memo(() => {
useSwitchSideBarOnInit(SettingsTabs.Common);
return (
<Layout>
<Common />
</Layout>
);
});

export default CommonSetting;
20 changes: 0 additions & 20 deletions src/app/settings/llm/index.tsx

This file was deleted.

23 changes: 18 additions & 5 deletions src/app/settings/llm/page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,20 @@
import Page from './index';
'use client';

const Index = () => {
return <Page />;
};
import { memo } from 'react';

export default Index;
import { useSwitchSideBarOnInit } from '@/store/global/hooks/useSwitchSettingsOnInit';
import { SettingsTabs } from '@/store/global/initialState';

import Layout from '../index';
import LLM from './LLM';

const LLMSetting = memo(() => {
useSwitchSideBarOnInit(SettingsTabs.LLM);
return (
<Layout>
<LLM />
</Layout>
);
});

export default LLMSetting;

0 comments on commit e86aff2

Please sign in to comment.