From b2d4d32375d7858cacdb56edd5c82643aab90010 Mon Sep 17 00:00:00 2001 From: "guangfei.zhao" Date: Fri, 7 Nov 2025 10:20:44 +0800 Subject: [PATCH] fix(agent): rename IFlow to IAgent for clarity --- src/components/agent/AgentCard.tsx | 9 +++++---- src/components/agent/AgentGridView.tsx | 16 ++++++++-------- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/src/components/agent/AgentCard.tsx b/src/components/agent/AgentCard.tsx index 519ba81..c70731c 100644 --- a/src/components/agent/AgentCard.tsx +++ b/src/components/agent/AgentCard.tsx @@ -10,13 +10,14 @@ import { } from '@mui/material'; import { MoreVert as MoreVertIcon } from '@mui/icons-material'; import { useTranslation } from 'react-i18next'; -import type { IFlow } from '@/interfaces/database/agent'; +import type { IAgent } from '@/interfaces/database/agent'; import dayjs from 'dayjs'; + interface AgentCardProps { - agent: IFlow; - onMenuClick: (event: React.MouseEvent, agent: IFlow) => void; - onViewAgent: (agent: IFlow) => void; + agent: IAgent; + onMenuClick: (event: React.MouseEvent, agent: IAgent) => void; + onViewAgent: (agent: IAgent) => void; } const AgentCard: React.FC = ({ agent, onMenuClick, onViewAgent }) => { diff --git a/src/components/agent/AgentGridView.tsx b/src/components/agent/AgentGridView.tsx index d261bcd..73a13b5 100644 --- a/src/components/agent/AgentGridView.tsx +++ b/src/components/agent/AgentGridView.tsx @@ -2,17 +2,17 @@ import React from 'react'; import { Box, Typography, Grid, Button, Menu, MenuItem } from '@mui/material'; import { ArrowForward as ArrowForwardIcon, Add as AddIcon } from '@mui/icons-material'; import { useTranslation } from 'react-i18next'; -import type { IFlow } from '@/interfaces/database/agent'; +import type { IAgent } from '@/interfaces/database/agent'; import AgentCard from './AgentCard'; interface AgentGridViewProps { - agents: IFlow[]; + agents: IAgent[]; maxItems?: number; showSeeAll?: boolean; onSeeAll?: () => void; - onEdit?: (agent: IFlow) => void; - onDelete?: (agent: IFlow) => void; - onView?: (agent: IFlow) => void; + onEdit?: (agent: IAgent) => void; + onDelete?: (agent: IAgent) => void; + onView?: (agent: IAgent) => void; loading?: boolean; searchTerm?: string; onCreateAgent?: () => void; @@ -32,9 +32,9 @@ const AgentGridView: React.FC = ({ }) => { const { t } = useTranslation(); const [anchorEl, setAnchorEl] = React.useState(null); - const [selectedAgent, setSelectedAgent] = React.useState(null); + const [selectedAgent, setSelectedAgent] = React.useState(null); - const handleMenuClick = (event: React.MouseEvent, agent: IFlow) => { + const handleMenuClick = (event: React.MouseEvent, agent: IAgent) => { setAnchorEl(event.currentTarget); setSelectedAgent(agent); }; @@ -58,7 +58,7 @@ const AgentGridView: React.FC = ({ handleMenuClose(); }; - const handleViewAgent = (agent: IFlow) => { + const handleViewAgent = (agent: IAgent) => { if (onView) { onView(agent); }