Prettier and eslint fixes in progress

This commit is contained in:
James Ketr 2025-06-20 11:55:25 -07:00
parent 0fba24b173
commit c1e6ab9360
9 changed files with 49 additions and 40 deletions

View File

@ -171,7 +171,9 @@ const Header: React.FC<HeaderProps> = (props: HeaderProps) => {
id: 'divider',
label: '',
icon: null,
action: () => {},
action: () => {
console.log('Divider clicked');
},
group: 'divider',
});
}
@ -197,7 +199,9 @@ const Header: React.FC<HeaderProps> = (props: HeaderProps) => {
id: 'divider',
label: '',
icon: null,
action: () => {},
action: () => {
console.log('Divider clicked');
},
group: 'divider',
});
}
@ -223,7 +227,9 @@ const Header: React.FC<HeaderProps> = (props: HeaderProps) => {
id: 'divider',
label: '',
icon: null,
action: () => {},
action: () => {
console.log('Divider clicked');
},
group: 'divider',
});
}

View File

@ -1,5 +1,4 @@
import React, { useEffect, useState } from 'react';
import { useNavigate } from 'react-router-dom';
import Box from '@mui/material/Box';
import { BackstoryElementProps } from 'components/BackstoryTab';
@ -15,7 +14,7 @@ interface CandidatePickerProps extends BackstoryElementProps {
const CandidatePicker = (props: CandidatePickerProps) => {
const { onSelect, sx } = props;
const { apiClient, user } = useAuth();
const { apiClient } = useAuth();
const { selectedCandidate, setSelectedCandidate } = useSelectedCandidate();
const { setSnack } = useAppState();
const [candidates, setCandidates] = useState<Candidate[] | null>(null);

View File

@ -1,6 +1,5 @@
import React from 'react';
import Box from '@mui/material/Box';
import { useTheme } from '@mui/material/styles';
import './ComingSoon.css';

View File

@ -202,7 +202,7 @@ const BetaPage: React.FC<BetaPageProps> = ({
}}
/>
<Typography>
We're working hard to bring you this exciting new feature!
We&apos;re working hard to bring you this exciting new feature!
</Typography>
<Typography color="textSecondary" sx={{ mt: 1 }}>
Check back soon for updates.

View File

@ -1,5 +1,5 @@
import React, { forwardRef, useState, useEffect, useRef } from 'react';
import { Box, Paper, Button, useTheme, Tooltip } from '@mui/material';
import { Box, Paper, Button, Tooltip } from '@mui/material';
import { Send as SendIcon } from '@mui/icons-material';
import { useAuth } from 'hooks/AuthContext';
import {
@ -15,7 +15,6 @@ import { BackstoryPageProps } from 'components/BackstoryTab';
import { Message } from 'components/Message';
import { DeleteConfirmation } from 'components/DeleteConfirmation';
import { CandidateInfo } from 'components/ui/CandidateInfo';
import { useNavigate } from 'react-router-dom';
import { useAppState, useSelectedCandidate } from 'hooks/GlobalContext';
import PropagateLoader from 'react-spinners/PropagateLoader';
import { BackstoryTextField, BackstoryTextFieldRef } from 'components/BackstoryTextField';

View File

@ -227,7 +227,6 @@ const HeroButton = (props: HeroButtonProps) => {
const HowItWorks: React.FC = () => {
const navigate = useNavigate();
const theme = useTheme();
const handleGetStarted = () => {
navigate('/job-analysis');

View File

@ -24,9 +24,8 @@ import { LoginForm } from 'components/EmailVerificationComponents';
import { CandidateRegistrationForm } from 'pages/candidate/RegistrationForms';
import { useNavigate, useParams } from 'react-router-dom';
import { useAppState } from 'hooks/GlobalContext';
import * as Types from 'types/types';
const LoginPage: React.FC<BackstoryPageProps> = (props: BackstoryPageProps) => {
const LoginPage: React.FC<BackstoryPageProps> = (_props: BackstoryPageProps) => {
const navigate = useNavigate();
const { setSnack } = useAppState();
const [tabValue, setTabValue] = useState<string>('login');

View File

@ -2,7 +2,6 @@ import React, { useEffect } from 'react';
import { useParams, useNavigate } from 'react-router-dom';
import { Box } from '@mui/material';
import { SetSnackType } from '../components/Snack';
import { LoadingComponent } from '../components/LoadingComponent';
import { User, Guest, Candidate } from 'types/types';
import { useAuth } from 'hooks/AuthContext';
@ -13,7 +12,7 @@ interface CandidateRouteProps {
user?: User | null;
}
const CandidateRoute: React.FC<CandidateRouteProps> = (props: CandidateRouteProps) => {
const CandidateRoute: React.FC<CandidateRouteProps> = (_props: CandidateRouteProps) => {
const { apiClient } = useAuth();
const { selectedCandidate, setSelectedCandidate } = useSelectedCandidate();
const { setSnack } = useAppState();

View File

@ -1470,11 +1470,13 @@ class ApiClient {
let streamingMessage: Types.ChatMessageStreaming | null = null;
try {
while (true) {
let exit = false;
while (!exit) {
const { done, value } = await reader.read();
if (done) {
// Stream ended naturally
exit = true;
break;
}
@ -1495,40 +1497,48 @@ class ApiClient {
// Handle different status types
switch (incoming.status) {
case 'streaming':
const streaming = Types.convertChatMessageStreamingFromApi(incoming);
if (streamingMessage === null) {
streamingMessage = { ...streaming };
} else {
// Can't do a simple += as typescript thinks .content might not be there
streamingMessage.content =
(streamingMessage?.content || '') + streaming.content;
// Update timestamp to latest
streamingMessage.timestamp = streaming.timestamp;
{
const streaming = Types.convertChatMessageStreamingFromApi(incoming);
if (streamingMessage === null) {
streamingMessage = { ...streaming };
} else {
// Can't do a simple += as typescript thinks .content might not be there
streamingMessage.content =
(streamingMessage?.content || '') + streaming.content;
// Update timestamp to latest
streamingMessage.timestamp = streaming.timestamp;
}
options.onStreaming?.(streamingMessage);
}
options.onStreaming?.(streamingMessage);
break;
case 'status':
const status = Types.convertChatMessageStatusFromApi(incoming);
options.onStatus?.(status);
{
const status = Types.convertChatMessageStatusFromApi(incoming);
options.onStatus?.(status);
}
break;
case 'error':
const error = Types.convertChatMessageErrorFromApi(incoming);
options.onError?.(error);
{
const error = Types.convertChatMessageErrorFromApi(incoming);
options.onError?.(error);
}
break;
case 'done':
const message = (
modelType
? convertFromApi<T>(parseApiResponse<T>(incoming), modelType)
: incoming
) as T;
finalMessage = message;
try {
options.onMessage?.(message);
} catch (error) {
console.error('onMessage handler failed: ', error);
{
const message = (
modelType
? convertFromApi<T>(parseApiResponse<T>(incoming), modelType)
: incoming
) as T;
finalMessage = message;
try {
options.onMessage?.(message);
} catch (error) {
console.error('onMessage handler failed: ', error);
}
}
break;
}
@ -1538,7 +1548,6 @@ class ApiClient {
if (error instanceof Error) {
options.onWarn?.(error.message);
}
// Continue processing other lines
}
}
}