Cleanup code and update OpenRouter settings

This commit is contained in:
Enrico Ros
2023-10-19 12:49:01 -07:00
parent 56cb1c6d24
commit ae3d4750f3
14 changed files with 157 additions and 196 deletions
@@ -0,0 +1,34 @@
import * as React from 'react';
import { Box, Button, FormLabel } from '@mui/joy';
import SyncIcon from '@mui/icons-material/Sync';
import type { ToggleableBoolean } from '~/common/util/useToggleableBoolean';
/**
* Bottom row: model reload and optional 'advanced' toggle
*/
export function SetupFormRefetchButton(props: { refetch: () => void, disabled: boolean, error: boolean, advanced?: ToggleableBoolean }) {
return (
<Box sx={{ display: 'flex', alignItems: 'end', justifyContent: 'space-between' }}>
{!!props.advanced && (
<FormLabel onClick={props.advanced.toggle} sx={{ textDecoration: 'underline', cursor: 'pointer' }}>
{props.advanced.on ? 'Hide Advanced' : 'Advanced'}
</FormLabel>
)}
<Button
variant='solid' color={props.error ? 'warning' : 'primary'}
disabled={props.disabled}
endDecorator={<SyncIcon />}
onClick={props.refetch}
sx={{ minWidth: 120, ml: 'auto' }}
>
Models
</Button>
</Box>
);
}