Clean up build errors
This commit is contained in:
@@ -1,4 +1,3 @@
|
|||||||
import { useQuery } from '@tanstack/react-query';
|
|
||||||
import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card';
|
import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card';
|
||||||
import { ResponsiveContainer, BarChart, Bar, XAxis, YAxis, Tooltip, ScatterChart, Scatter, ZAxis } from 'recharts';
|
import { ResponsiveContainer, BarChart, Bar, XAxis, YAxis, Tooltip, ScatterChart, Scatter, ZAxis } from 'recharts';
|
||||||
import config from '../../config';
|
import config from '../../config';
|
||||||
|
|||||||
@@ -95,12 +95,8 @@ export const AiValidationDialogs: React.FC<AiValidationDialogsProps> = ({
|
|||||||
isChangeReverted,
|
isChangeReverted,
|
||||||
getFieldDisplayValueWithHighlight,
|
getFieldDisplayValueWithHighlight,
|
||||||
fields,
|
fields,
|
||||||
debugData,
|
|
||||||
}) => {
|
}) => {
|
||||||
const [costPerMillionTokens, setCostPerMillionTokens] = useState(2.5); // Default cost
|
const [costPerMillionTokens, setCostPerMillionTokens] = useState(2.5); // Default cost
|
||||||
const hasCompanyPrompts =
|
|
||||||
currentPrompt.debugData?.promptSources?.companyPrompts &&
|
|
||||||
currentPrompt.debugData.promptSources.companyPrompts.length > 0;
|
|
||||||
|
|
||||||
// Create our own state to track changes
|
// Create our own state to track changes
|
||||||
const [localReversionState, setLocalReversionState] = useState<
|
const [localReversionState, setLocalReversionState] = useState<
|
||||||
@@ -157,17 +153,6 @@ export const AiValidationDialogs: React.FC<AiValidationDialogsProps> = ({
|
|||||||
return !!localReversionState[key];
|
return !!localReversionState[key];
|
||||||
};
|
};
|
||||||
|
|
||||||
// Use "full" as the default tab
|
|
||||||
const defaultTab = "full";
|
|
||||||
const [activeTab, setActiveTab] = useState(defaultTab);
|
|
||||||
|
|
||||||
// Update activeTab when the dialog is opened with new data
|
|
||||||
React.useEffect(() => {
|
|
||||||
if (currentPrompt.isOpen) {
|
|
||||||
setActiveTab("full");
|
|
||||||
}
|
|
||||||
}, [currentPrompt.isOpen]);
|
|
||||||
|
|
||||||
// Format time helper
|
// Format time helper
|
||||||
const formatTime = (seconds: number): string => {
|
const formatTime = (seconds: number): string => {
|
||||||
if (seconds < 60) {
|
if (seconds < 60) {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { useState, useMemo, useCallback, useRef, useEffect } from "react";
|
import { useState, useMemo, useCallback, useEffect } from "react";
|
||||||
import { useQuery, useMutation, useQueryClient } from "@tanstack/react-query";
|
import { useQuery, useMutation, useQueryClient } from "@tanstack/react-query";
|
||||||
import { Button } from "@/components/ui/button";
|
import { Button } from "@/components/ui/button";
|
||||||
import {
|
import {
|
||||||
@@ -90,7 +90,7 @@ const ImageForm = ({
|
|||||||
}: {
|
}: {
|
||||||
editingImage: ReusableImage | null;
|
editingImage: ReusableImage | null;
|
||||||
formData: ImageFormData;
|
formData: ImageFormData;
|
||||||
setFormData: (data: ImageFormData) => void;
|
setFormData: (data: ImageFormData | ((prev: ImageFormData) => ImageFormData)) => void;
|
||||||
onSubmit: (e: React.FormEvent) => void;
|
onSubmit: (e: React.FormEvent) => void;
|
||||||
onCancel: () => void;
|
onCancel: () => void;
|
||||||
fieldOptions: FieldOptions | undefined;
|
fieldOptions: FieldOptions | undefined;
|
||||||
@@ -99,11 +99,11 @@ const ImageForm = ({
|
|||||||
isDragActive: boolean;
|
isDragActive: boolean;
|
||||||
}) => {
|
}) => {
|
||||||
const handleNameChange = useCallback((e: React.ChangeEvent<HTMLInputElement>) => {
|
const handleNameChange = useCallback((e: React.ChangeEvent<HTMLInputElement>) => {
|
||||||
setFormData(prev => ({ ...prev, name: e.target.value }));
|
setFormData((prev: ImageFormData) => ({ ...prev, name: e.target.value }));
|
||||||
}, [setFormData]);
|
}, [setFormData]);
|
||||||
|
|
||||||
const handleGlobalChange = useCallback((checked: boolean) => {
|
const handleGlobalChange = useCallback((checked: boolean) => {
|
||||||
setFormData(prev => ({
|
setFormData((prev: ImageFormData) => ({
|
||||||
...prev,
|
...prev,
|
||||||
is_global: checked,
|
is_global: checked,
|
||||||
company: checked ? null : prev.company
|
company: checked ? null : prev.company
|
||||||
@@ -111,7 +111,7 @@ const ImageForm = ({
|
|||||||
}, [setFormData]);
|
}, [setFormData]);
|
||||||
|
|
||||||
const handleCompanyChange = useCallback((value: string) => {
|
const handleCompanyChange = useCallback((value: string) => {
|
||||||
setFormData(prev => ({ ...prev, company: value }));
|
setFormData((prev: ImageFormData) => ({ ...prev, company: value }));
|
||||||
}, [setFormData]);
|
}, [setFormData]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -738,7 +738,13 @@ export function ReusableImageManagement() {
|
|||||||
</DialogContent>
|
</DialogContent>
|
||||||
</Dialog>
|
</Dialog>
|
||||||
|
|
||||||
<style jsx global>{`
|
{/* Add global styles for this component using regular style tag */}
|
||||||
|
<style>{`
|
||||||
|
.reusable-image-table thead tr th,
|
||||||
|
.reusable-image-table tbody tr td {
|
||||||
|
padding-left: 1rem;
|
||||||
|
padding-right: 1rem;
|
||||||
|
}
|
||||||
.bg-checkerboard {
|
.bg-checkerboard {
|
||||||
background-image: linear-gradient(45deg, #f0f0f0 25%, transparent 25%),
|
background-image: linear-gradient(45deg, #f0f0f0 25%, transparent 25%),
|
||||||
linear-gradient(-45deg, #f0f0f0 25%, transparent 25%),
|
linear-gradient(-45deg, #f0f0f0 25%, transparent 25%),
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user