This repository has been archived on 2025-11-27. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
Fitz_Studio/frontend/src/components/MetodoSelect.tsx
T
egutierrez b4ca0cf600 Refactor project structure and implement new features
- Removed unused security module and updated import paths.
- Enhanced OpenAI client with streaming capabilities for chat completions.
- Added new backend API endpoints for health check (ping).
- Established a new FastAPI application with CORS configuration.
- Created a new Appshell component for the frontend with navigation links.
- Integrated SVG icons and improved styling for the Appshell component.
- Implemented memory management for conversation history using PostgreSQL.
- Developed abstract classes for AI agents and models, with OpenAI integration.
- Added encryption utilities for secure data handling.
2025-05-06 23:33:41 +02:00

53 lines
1.2 KiB
TypeScript

import { Select, Group } from '@mantine/core';
import { IconCheck } from '../assets/icons';
interface MetodoSelectProps {
metodo: string;
setMetodo: (value: string) => void;
}
const metodoData = [
{ value: 'GET', label: 'GET' },
{ value: 'POST', label: 'POST' },
{ value: 'PUT', label: 'PUT' },
{ value: 'DELETE', label: 'DELETE' },
];
const colorMap: Record<string, string> = {
GET: '#10b981', // verde
POST: '#3b82f6', // azul
PUT: '#f59e0b', // naranja
DELETE: '#ef4444', // rojo
};
const backgroundMap: Record<string, string> = {
GET: '#d1fae5',
POST: '#e0f2fe',
PUT: '#fef3c7',
DELETE: '#fee2e2',
};
export function MetodoSelect({ metodo, setMetodo }: MetodoSelectProps) {
return (
<Select
label="Método"
value={metodo}
onChange={(value) => setMetodo(value!)}
data={metodoData}
renderOption={({ option, checked }) => (
<Group style={{ color: colorMap[option.value], fontWeight: 600 }}>
{option.label}
{checked && <IconCheck/>}
</Group>
)}
styles={{
input: {
backgroundColor: backgroundMap[metodo],
color: '#111',
fontWeight: 600,
},
}}
/>
);
}