fix(agent): rename IFlow to IAgent for clarity
This commit is contained in:
@@ -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 }) => {
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user