fix(agent): rename IFlow to IAgent for clarity

This commit is contained in:
2025-11-07 10:20:44 +08:00
parent ddce6638ad
commit b2d4d32375
2 changed files with 13 additions and 12 deletions

View File

@@ -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<HTMLElement>, agent: IFlow) => void;
onViewAgent: (agent: IFlow) => void;
agent: IAgent;
onMenuClick: (event: React.MouseEvent<HTMLElement>, agent: IAgent) => void;
onViewAgent: (agent: IAgent) => void;
}
const AgentCard: React.FC<AgentCardProps> = ({ agent, onMenuClick, onViewAgent }) => {

View File

@@ -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<AgentGridViewProps> = ({
}) => {
const { t } = useTranslation();
const [anchorEl, setAnchorEl] = React.useState<null | HTMLElement>(null);
const [selectedAgent, setSelectedAgent] = React.useState<IFlow | null>(null);
const [selectedAgent, setSelectedAgent] = React.useState<IAgent | null>(null);
const handleMenuClick = (event: React.MouseEvent<HTMLElement>, agent: IFlow) => {
const handleMenuClick = (event: React.MouseEvent<HTMLElement>, agent: IAgent) => {
setAnchorEl(event.currentTarget);
setSelectedAgent(agent);
};
@@ -58,7 +58,7 @@ const AgentGridView: React.FC<AgentGridViewProps> = ({
handleMenuClose();
};
const handleViewAgent = (agent: IFlow) => {
const handleViewAgent = (agent: IAgent) => {
if (onView) {
onView(agent);
}