chore(ai): remove some types

- Removed deprecated analytics types from the usage types file to simplify the codebase.
- Updated component files to import types directly from the client SDK, enhancing maintainability and clarity.
- Adjusted type definitions in the PatternsTab component to reflect the new usage pattern structure.

These changes aim to improve code organization and reduce redundancy in type definitions.

Signed-off-by: Innei <tukon479@gmail.com>
This commit is contained in:
Innei
2025-08-27 20:49:27 +08:00
parent 9bd672969b
commit a05c3950db
4 changed files with 4 additions and 23 deletions
@@ -1,7 +1,7 @@
import { Card, CardContent, CardHeader, CardTitle } from "@follow/components/ui/card/index.jsx"
import type { ModelPattern } from "@follow-app/client-sdk"
import { useTranslation } from "react-i18next"
import type { ModelPattern } from "../types"
import { formatTokenCount } from "../utils"
import { BarList } from "./charts"
@@ -1,7 +1,7 @@
import { Card, CardContent, CardHeader, CardTitle } from "@follow/components/ui/card/index.jsx"
import type { DailyPattern } from "@follow-app/client-sdk"
import { useTranslation } from "react-i18next"
import type { DailyPattern } from "../types"
import { formatTokenCount } from "../utils"
import { Sparkline } from "./charts"
@@ -1,14 +1,14 @@
import { Card, CardContent, CardHeader, CardTitle } from "@follow/components/ui/card/index.jsx"
import type { UsagePattern } from "@follow-app/client-sdk"
import { useTranslation } from "react-i18next"
import type { OperationPattern } from "../types"
import { formatTokenCount } from "../utils"
import { BarList, TinyBars } from "./charts"
interface PatternsTabProps {
hourBuckets: number[]
maxHourCount: number
byOperation: OperationPattern[]
byOperation: UsagePattern[]
}
export const PatternsTab = ({ hourBuckets, maxHourCount, byOperation }: PatternsTabProps) => {
@@ -1,22 +1,3 @@
// Analytics Types
export interface DailyPattern {
date: string
totalTokens: number
peakHour?: number | null
}
export interface OperationPattern {
operationType: string
percentage: number
totalTokens: number
}
export interface ModelPattern {
model: string
avgEfficiency: number
totalTokens: number
}
// Chart Data Types
export interface ChartDataPoint {
label: string