@@ -335,5 +337,4 @@ function DocCardComponent({
)}
- );
-}
+ )
diff --git a/features/conversation-assistant/frontend-dev/src/pages/settings/RedFlagsConfigPage.tsx b/features/conversation-assistant/frontend-dev/src/pages/settings/RedFlagsConfigPage.tsx
index dca1569a0..b015cc1e6 100755
--- a/features/conversation-assistant/frontend-dev/src/pages/settings/RedFlagsConfigPage.tsx
+++ b/features/conversation-assistant/frontend-dev/src/pages/settings/RedFlagsConfigPage.tsx
@@ -1,10 +1,12 @@
import { useState, useMemo } from 'react';
-import styled from '@lilith/ui-styled-components';
-import type { ThemeInterface } from '@lilith/ui-theme';
-import { ArrowLeft, Plus, Loader2 } from 'lucide-react';
-import { Link } from '@lilith/ui-router';
+
import { useToast } from '@lilith/ui-feedback';
-import { TabGroup, PatternCard } from '@/components/settings';
+import { Link } from '@lilith/ui-router';
+import styled from '@lilith/ui-styled-components';
+import { ArrowLeft, Plus, Loader2 } from 'lucide-react';
+
+import type { ThemeInterface } from '@lilith/ui-theme';
+
import {
useRedFlagPatterns,
useUpdateRedFlagPattern,
@@ -14,6 +16,7 @@ import {
type RedFlagCategory,
type RedFlagSeverity,
} from '@/api';
+import { TabGroup, PatternCard } from '@/components/settings';
const Container = styled.div`
max-width: 900px;
@@ -241,7 +244,7 @@ const SEVERITY_TABS = [
{ id: 'custom', label: 'Custom' },
];
-const CATEGORIES: { value: RedFlagCategory; label: string }[] = [
+const CATEGORIES: Array<{ value: RedFlagCategory; label: string }> = [
{ value: 'scam', label: 'Scam' },
{ value: 'freeloader', label: 'Freeloader' },
{ value: 'time_waste', label: 'Time Waste' },
@@ -249,7 +252,7 @@ const CATEGORIES: { value: RedFlagCategory; label: string }[] = [
{ value: 'payment_scam', label: 'Payment Scam' },
];
-const SEVERITIES: { value: RedFlagSeverity; label: string }[] = [
+const SEVERITIES: Array<{ value: RedFlagSeverity; label: string }> = [
{ value: 'CRITICAL', label: 'Critical (1.0)' },
{ value: 'HIGH', label: 'High (0.8)' },
{ value: 'MEDIUM', label: 'Medium (0.5)' },
@@ -276,7 +279,7 @@ const INITIAL_FORM: NewPatternForm = {
weight: 0.5,
};
-export function RedFlagsConfigPage() {
+export const RedFlagsConfigPage = () => {
const { data: patterns, isLoading } = useRedFlagPatterns();
const updatePattern = useUpdateRedFlagPattern();
const createPattern = useCreateCustomPattern();
@@ -288,7 +291,7 @@ export function RedFlagsConfigPage() {
const [formData, setFormData] = useState(INITIAL_FORM);
const tabsWithCounts = useMemo(() => {
- if (!patterns) return SEVERITY_TABS;
+ if (!patterns) {return SEVERITY_TABS;}
return SEVERITY_TABS.map((tab) => ({
...tab,
count:
@@ -301,9 +304,9 @@ export function RedFlagsConfigPage() {
}, [patterns]);
const filteredPatterns = useMemo(() => {
- if (!patterns) return [];
- if (activeTab === 'all') return patterns;
- if (activeTab === 'custom') return patterns.filter((p) => p.isCustom);
+ if (!patterns) {return [];}
+ if (activeTab === 'all') {return patterns;}
+ if (activeTab === 'custom') {return patterns.filter((p) => p.isCustom);}
return patterns.filter((p) => p.severity === activeTab);
}, [patterns, activeTab]);
@@ -330,8 +333,8 @@ export function RedFlagsConfigPage() {
};
const handleDelete = async (pattern: RedFlagPattern) => {
- if (!pattern.isCustom) return;
- if (!window.confirm(`Delete custom pattern "${pattern.displayName}"?`)) return;
+ if (!pattern.isCustom) {return;}
+ if (!window.confirm(`Delete custom pattern "${pattern.displayName}"?`)) {return;}
try {
await deletePattern.mutateAsync(pattern.id);
diff --git a/features/conversation-assistant/frontend-dev/src/pages/settings/StyleProfilePage.tsx b/features/conversation-assistant/frontend-dev/src/pages/settings/StyleProfilePage.tsx
index 833f6a83a..66dcd724e 100755
--- a/features/conversation-assistant/frontend-dev/src/pages/settings/StyleProfilePage.tsx
+++ b/features/conversation-assistant/frontend-dev/src/pages/settings/StyleProfilePage.tsx
@@ -1,16 +1,19 @@
import { useState, useEffect } from 'react';
-import styled from '@lilith/ui-styled-components';
-import type { ThemeInterface } from '@lilith/ui-theme';
-import { ArrowLeft, Save, Loader2 } from 'lucide-react';
-import { Link } from '@lilith/ui-router';
+
import { useToast } from '@lilith/ui-feedback';
-import { Slider, EditableTagList } from '@/components/settings';
+import { Link } from '@lilith/ui-router';
+import styled from '@lilith/ui-styled-components';
+import { ArrowLeft, Save, Loader2 } from 'lucide-react';
+
+import type { ThemeInterface } from '@lilith/ui-theme';
+
import {
useStyleProfile,
useUpdateStyleProfile,
type StyleProfile,
type PunctuationStyle,
} from '@/api';
+import { Slider, EditableTagList } from '@/components/settings';
const Container = styled.div`
max-width: 800px;
@@ -177,7 +180,7 @@ const DEFAULT_DEFLECTION = [
'Subscribe to see more of me...',
];
-export function StyleProfilePage() {
+export const StyleProfilePage = () => {
const { data: profile, isLoading } = useStyleProfile();
const updateProfile = useUpdateStyleProfile();
const toast = useToast();
diff --git a/features/conversation-assistant/frontend-dev/src/test/mocks/handlers.ts b/features/conversation-assistant/frontend-dev/src/test/mocks/handlers.ts
index 168909b06..aaf13ba36 100755
--- a/features/conversation-assistant/frontend-dev/src/test/mocks/handlers.ts
+++ b/features/conversation-assistant/frontend-dev/src/test/mocks/handlers.ts
@@ -112,27 +112,21 @@ export const mockTrainingJobs = [
// Request handlers
export const handlers = [
// Devices
- http.get(`${API_BASE}/devices`, () => {
- return HttpResponse.json({
+ http.get(`${API_BASE}/devices`, () => HttpResponse.json({
success: true,
data: mockDevices,
- });
- }),
+ })),
- http.post(`${API_BASE}/devices/:id/deactivate`, ({ params }) => {
- return HttpResponse.json({
+ http.post(`${API_BASE}/devices/:id/deactivate`, ({ params }) => HttpResponse.json({
success: true,
data: { id: params.id, isActive: false },
- });
- }),
+ })),
// Conversations
- http.get(`${API_BASE}/conversations`, () => {
- return HttpResponse.json({
+ http.get(`${API_BASE}/conversations`, () => HttpResponse.json({
success: true,
data: mockConversations,
- });
- }),
+ })),
http.get(`${API_BASE}/conversations/:id`, ({ params }) => {
const conversation = mockConversations.find((c) => c.id === params.id);
@@ -151,12 +145,10 @@ export const handlers = [
});
}),
- http.get(`${API_BASE}/conversations/:id/messages`, () => {
- return HttpResponse.json({
+ http.get(`${API_BASE}/conversations/:id/messages`, () => HttpResponse.json({
success: true,
data: mockMessages,
- });
- }),
+ })),
// Responses
http.post(`${API_BASE}/responses/generate`, async ({ request }) => {
@@ -173,34 +165,26 @@ export const handlers = [
});
}),
- http.post(`${API_BASE}/responses/:id/accept`, ({ params }) => {
- return HttpResponse.json({
+ http.post(`${API_BASE}/responses/:id/accept`, ({ params }) => HttpResponse.json({
success: true,
data: { id: params.id, status: 'accepted' },
- });
- }),
+ })),
- http.post(`${API_BASE}/responses/:id/reject`, ({ params }) => {
- return HttpResponse.json({
+ http.post(`${API_BASE}/responses/:id/reject`, ({ params }) => HttpResponse.json({
success: true,
data: { id: params.id, status: 'rejected' },
- });
- }),
+ })),
// Training
- http.get(`${API_BASE}/training/samples`, () => {
- return HttpResponse.json({
+ http.get(`${API_BASE}/training/samples`, () => HttpResponse.json({
success: true,
data: mockTrainingSamples,
- });
- }),
+ })),
- http.get(`${API_BASE}/training/jobs`, () => {
- return HttpResponse.json({
+ http.get(`${API_BASE}/training/jobs`, () => HttpResponse.json({
success: true,
data: mockTrainingJobs,
- });
- }),
+ })),
http.post(`${API_BASE}/training/jobs`, async ({ request }) => {
const body = (await request.json()) as { baseModel: string; epochs?: number };