streaming, markdown, model selecting, and lots more
This commit is contained in:
@@ -1,13 +1,28 @@
|
||||
export const useSettings = () => {
|
||||
const open = useState<boolean>('settings:open', () => false)
|
||||
const currentPage = useState<string>('settings:currentPage', () => 'page1')
|
||||
const open = useState<boolean>('settings:open', () => false);
|
||||
const currentPage = useState('settings-page', () => 'general');
|
||||
const pageParams = useState('settings-params', () => [] as string[]);
|
||||
|
||||
const toggle = () => {
|
||||
open.value = !open.value;
|
||||
};
|
||||
|
||||
const setPage = (id: string, params?: string | string[]) => {
|
||||
currentPage.value = id;
|
||||
if (params) {
|
||||
if (typeof params === 'string') {
|
||||
params = [params];
|
||||
}
|
||||
pageParams.value = params;
|
||||
} else {
|
||||
pageParams.value = [];
|
||||
}
|
||||
};
|
||||
|
||||
const toggle = () => { open.value = !open.value }
|
||||
const setPage = (page: string) => { currentPage.value = page }
|
||||
const close = () => {
|
||||
open.value = false
|
||||
currentPage.value = 'page1'
|
||||
}
|
||||
open.value = false;
|
||||
currentPage.value = 'page1';
|
||||
};
|
||||
|
||||
return { open, currentPage, toggle, setPage, close }
|
||||
}
|
||||
return { open, currentPage, pageParams, toggle, setPage, close };
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user