Skip to content

Commit

Permalink
Merge pull request #106 from PySpur-Dev/fix/build-errors
Browse files Browse the repository at this point in the history
Fix/build-errors
  • Loading branch information
srijanpatel authored Jan 21, 2025
2 parents cfa3517 + e1cfb83 commit 90d0605
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 25 deletions.
2 changes: 1 addition & 1 deletion frontend/src/components/Dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ const Dashboard: React.FC = () => {
(apiKeys.length === 0 || apiKeys.every((key) => !key.value || key.value === '')) && (
<div className="w-full">
<Alert
variant="warning"
variant="bordered"
className="mb-2"
startContent={<Icon icon="lucide:alert-triangle" width={16} />}
>
Expand Down
37 changes: 19 additions & 18 deletions frontend/src/components/modals/SettingsModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,25 +61,26 @@ type SwitchCellProps = Omit<SwitchProps, 'color'> & {
}
}

const SwitchCell = React.forwardRef<HTMLInputElement, SwitchCellProps>(
const SwitchCell = React.forwardRef<HTMLDivElement, SwitchCellProps>(
({ label, description, classNames, ...props }, ref) => (
<CustomSwitch
ref={ref}
classNames={{
...classNames,
base: cn(
'inline-flex bg-content2 flex-row-reverse w-full max-w-full items-center',
'justify-between cursor-pointer rounded-medium gap-2 p-4',
classNames?.base
),
}}
{...props}
>
<div className="flex flex-col">
<p className={cn('text-medium', classNames?.label)}>{label}</p>
<p className={cn('text-small text-default-500', classNames?.description)}>{description}</p>
</div>
</CustomSwitch>
<div ref={ref}>
<CustomSwitch
classNames={{
...classNames,
base: cn(
'inline-flex bg-content2 flex-row-reverse w-full max-w-full items-center',
'justify-between cursor-pointer rounded-medium gap-2 p-4',
classNames?.base
),
}}
{...props}
>
<div className="flex flex-col">
<p className={cn('text-medium', classNames?.label)}>{label}</p>
<p className={cn('text-small text-default-500', classNames?.description)}>{description}</p>
</div>
</CustomSwitch>
</div>
)
)

Expand Down
6 changes: 3 additions & 3 deletions frontend/src/components/rag/DocumentCollectionWizard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export const DocumentCollectionWizard = () => {
const [activeStep, setActiveStep] = useState(0)
const [files, setFiles] = useState<File[]>([])
const [isSubmitting, setIsSubmitting] = useState(false)
const [alert, setAlert] = useState<{ type: 'success' | 'error'; message: string } | null>(null)
const [alert, setAlert] = useState<{ type: 'success' | 'danger'; message: string } | null>(null)
const [nameAlert, setNameAlert] = useState<string | null>(null)
const [config, setConfig] = useState<TextProcessingConfig>({
name: '',
Expand Down Expand Up @@ -156,7 +156,7 @@ export const DocumentCollectionWizard = () => {
router.push(`/rag/collections/${response.id}`)
} catch (error) {
console.error('Error creating collection:', error)
setAlert({ type: 'error', message: 'Error creating document collection' })
setAlert({ type: 'danger', message: 'Error creating document collection' })
} finally {
setIsSubmitting(false)
}
Expand Down Expand Up @@ -304,7 +304,7 @@ export const DocumentCollectionWizard = () => {
} catch (error) {
console.error('Error creating collection:', error)
setAlert({
type: 'error',
type: 'danger',
message: 'Error creating document collection',
})
} finally {
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/components/rag/VectorIndexWizard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export const VectorIndexWizard: React.FC = () => {
const [apiKeys, setApiKeys] = useState<Record<string, string>>({})
const [isLoadingModels, setIsLoadingModels] = useState(true)
const [isLoadingStores, setIsLoadingStores] = useState(true)
const [alert, setAlert] = useState<{ type: 'success' | 'error'; message: string } | null>(null)
const [alert, setAlert] = useState<{ type: 'success' | 'danger'; message: string } | null>(null)
const [config, setConfig] = useState<EmbeddingConfig>({
name: '',
description: '',
Expand Down Expand Up @@ -160,7 +160,7 @@ export const VectorIndexWizard: React.FC = () => {
setVectorStores(storesData)
} catch (error) {
console.error('Error fetching data:', error)
setAlert({ type: 'error', message: 'Error loading configuration options' })
setAlert({ type: 'danger', message: 'Error loading configuration options' })
}
}
fetchData()
Expand Down Expand Up @@ -225,7 +225,7 @@ export const VectorIndexWizard: React.FC = () => {
router.push(`/rag/indices/${index.id}`)
} catch (error) {
console.error('Error creating index:', error)
setAlert({ type: 'error', message: 'Error creating vector index' })
setAlert({ type: 'danger', message: 'Error creating vector index' })
} finally {
setIsSubmitting(false)
}
Expand Down

0 comments on commit 90d0605

Please sign in to comment.