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'; } from '@mui/material';
import { MoreVert as MoreVertIcon } from '@mui/icons-material'; import { MoreVert as MoreVertIcon } from '@mui/icons-material';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
import type { IFlow } from '@/interfaces/database/agent'; import type { IAgent } from '@/interfaces/database/agent';
import dayjs from 'dayjs'; import dayjs from 'dayjs';
interface AgentCardProps { interface AgentCardProps {
agent: IFlow; agent: IAgent;
onMenuClick: (event: React.MouseEvent<HTMLElement>, agent: IFlow) => void; onMenuClick: (event: React.MouseEvent<HTMLElement>, agent: IAgent) => void;
onViewAgent: (agent: IFlow) => void; onViewAgent: (agent: IAgent) => void;
} }
const AgentCard: React.FC<AgentCardProps> = ({ agent, onMenuClick, onViewAgent }) => { 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 { Box, Typography, Grid, Button, Menu, MenuItem } from '@mui/material';
import { ArrowForward as ArrowForwardIcon, Add as AddIcon } from '@mui/icons-material'; import { ArrowForward as ArrowForwardIcon, Add as AddIcon } from '@mui/icons-material';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
import type { IFlow } from '@/interfaces/database/agent'; import type { IAgent } from '@/interfaces/database/agent';
import AgentCard from './AgentCard'; import AgentCard from './AgentCard';
interface AgentGridViewProps { interface AgentGridViewProps {
agents: IFlow[]; agents: IAgent[];
maxItems?: number; maxItems?: number;
showSeeAll?: boolean; showSeeAll?: boolean;
onSeeAll?: () => void; onSeeAll?: () => void;
onEdit?: (agent: IFlow) => void; onEdit?: (agent: IAgent) => void;
onDelete?: (agent: IFlow) => void; onDelete?: (agent: IAgent) => void;
onView?: (agent: IFlow) => void; onView?: (agent: IAgent) => void;
loading?: boolean; loading?: boolean;
searchTerm?: string; searchTerm?: string;
onCreateAgent?: () => void; onCreateAgent?: () => void;
@@ -32,9 +32,9 @@ const AgentGridView: React.FC<AgentGridViewProps> = ({
}) => { }) => {
const { t } = useTranslation(); const { t } = useTranslation();
const [anchorEl, setAnchorEl] = React.useState<null | HTMLElement>(null); 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); setAnchorEl(event.currentTarget);
setSelectedAgent(agent); setSelectedAgent(agent);
}; };
@@ -58,7 +58,7 @@ const AgentGridView: React.FC<AgentGridViewProps> = ({
handleMenuClose(); handleMenuClose();
}; };
const handleViewAgent = (agent: IFlow) => { const handleViewAgent = (agent: IAgent) => {
if (onView) { if (onView) {
onView(agent); onView(agent);
} }