fix: address lint issues and type errors

This commit is contained in:
vgcman16
2025-06-05 19:07:41 -05:00
parent 4350bf66c3
commit f23482db2f
9 changed files with 52 additions and 31 deletions

View File

@@ -288,8 +288,7 @@ export const BaseChat = React.forwardRef<HTMLDivElement, BaseChatProps>(
const handleFileUpload = () => {
const input = document.createElement('input');
input.type = 'file';
input.accept =
'image/*,.pdf,.docx,.txt,.md,.js,.ts,.tsx,.html,.css,.json';
input.accept = 'image/*,.pdf,.docx,.txt,.md,.js,.ts,.tsx,.html,.css,.json';
input.onchange = async (e) => {
const file = (e.target as HTMLInputElement).files?.[0];
@@ -297,6 +296,7 @@ export const BaseChat = React.forwardRef<HTMLDivElement, BaseChatProps>(
if (file) {
if (file.type.startsWith('image/')) {
const reader = new FileReader();
reader.onload = (ev) => {
const base64Image = ev.target?.result as string;
setUploadedFiles?.([...uploadedFiles, file]);
@@ -326,11 +326,16 @@ export const BaseChat = React.forwardRef<HTMLDivElement, BaseChatProps>(
for (const item of items) {
if (item.kind === 'file') {
const file = item.getAsFile();
if (!file) continue;
if (!file) {
continue;
}
e.preventDefault();
if (file.type.startsWith('image/')) {
const reader = new FileReader();
reader.onload = (ev) => {
const base64Image = ev.target?.result as string;
setUploadedFiles?.([...uploadedFiles, file]);

View File

@@ -449,6 +449,7 @@ function FileContextMenu({
}
const success = workbenchStore.targetFile(fullPath);
if (success) {
toast.success(`File targeted`);
}
@@ -465,6 +466,7 @@ function FileContextMenu({
}
const success = workbenchStore.unTargetFile(fullPath);
if (success) {
toast.success(`File un-targeted`);
}
@@ -761,9 +763,7 @@ function File({
title={'File is locked'}
/>
)}
{isTargeted && (
<span className="shrink-0 i-ph:crosshair text-green-500 scale-80" title="Targeted file" />
)}
{isTargeted && <span className="shrink-0 i-ph:crosshair text-green-500 scale-80" title="Targeted file" />}
{unsavedChanges && <span className="i-ph:circle-fill scale-68 shrink-0 text-orange-500" />}
</div>
</div>