fix: correction des erreurs de linting pour le QA
This commit is contained in:
@@ -5,6 +5,8 @@ import { Button } from '@/components/ui/Button';
|
||||
import { Input } from '@/components/ui/Input';
|
||||
import { Select } from '@/components/ui/Select';
|
||||
import { Textarea } from '@/components/ui/Textarea';
|
||||
import type { TicketCategory } from '@/types/Category';
|
||||
import type { ButtonVariantStyle } from '@/styles/VariantStyle';
|
||||
|
||||
interface NewTicketWidgetProps {
|
||||
onCancel: () => void;
|
||||
@@ -15,13 +17,13 @@ export const NewTicketWidget: React.FC<NewTicketWidgetProps> = ({ onCancel, onSu
|
||||
const { createTicket, isSubmitting, error } = useCreateTicket();
|
||||
|
||||
// États locaux isolés dans le widget
|
||||
const [category, setCategory] = useState<'Incident Critique' | 'Évolution' | 'Administratif'>('Incident Critique');
|
||||
const [category, setCategory] = useState<TicketCategory>('Incident Critique');
|
||||
const [ci, setCi] = useState('general');
|
||||
const [subject, setSubject] = useState('');
|
||||
const [affectedAsset, setAffectedAsset] = useState('');
|
||||
const [incidentTime, setIncidentTime] = useState('');
|
||||
const [description, setDescription] = useState('');
|
||||
const [buttonVariant, setButtonVariant]=useState('primary');
|
||||
const [buttonVariant, setButtonVariant]=useState<ButtonVariantStyle>('primary');
|
||||
|
||||
const handleSubmit = async (e: React.FormEvent) => {
|
||||
e.preventDefault();
|
||||
@@ -62,7 +64,7 @@ export const NewTicketWidget: React.FC<NewTicketWidgetProps> = ({ onCancel, onSu
|
||||
<Select
|
||||
label="Type de demande"
|
||||
value={category}
|
||||
onChange={(e) => {setCategory(e.target.value as any); setButtonVariant(e.target.value==="Incident Critique"?"danger":"primary")}}
|
||||
onChange={(e) => {setCategory(e.target.value as TicketCategory); setButtonVariant(e.target.value==="Incident Critique"?"danger":"primary")}}
|
||||
options={[
|
||||
{ value: 'Incident Critique', label: 'Incident Critique (Panne, Dégradation)' },
|
||||
{ value: 'Évolution', label: 'Évolution (Ajout de ressources, Modification)' },
|
||||
|
||||
@@ -28,7 +28,7 @@ export const TicketChatWidget: React.FC<TicketChatWidgetProps> = ({
|
||||
try {
|
||||
await onSendMessage(newMessage);
|
||||
setNewMessage(''); // Vide l'input uniquement si l'envoi réussit
|
||||
} catch (err) {
|
||||
} catch {
|
||||
alert("Erreur lors de l'envoi.");
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user