refacto react component

This commit is contained in:
Matthieu
2025-08-11 22:30:36 +02:00
parent 43ee493f9e
commit 160aea6128
10 changed files with 42 additions and 43 deletions

View File

@@ -1,4 +1,4 @@
import React, { useState } from 'react';
import { useState } from 'react';
import { Plus, Trash2 } from 'lucide-react';
import type { NPCConfiguration, NPCPartyProvider, SimplePartyProvider, PoolPartyProvider, PoolEntry } from '../types/npc';
@@ -7,7 +7,7 @@ interface NPCPartyBuilderProps {
onChange: (config: NPCConfiguration) => void;
}
export const NPCPartyBuilder: React.FC<NPCPartyBuilderProps> = ({ config, onChange }) => {
export function NPCPartyBuilder({ config, onChange }: NPCPartyBuilderProps) {
const [partyType, setPartyType] = useState<'simple' | 'pool' | 'script'>(config.party?.type || 'simple');
const handlePartyChange = (party: NPCPartyProvider) => {
@@ -323,4 +323,4 @@ export const NPCPartyBuilder: React.FC<NPCPartyBuilderProps> = ({ config, onChan
{partyType === 'script' && renderScriptParty()}
</div>
);
};
}