Make CreaturePartEditor generic.

pull/230/head
Atul Varma 2021-09-28 10:55:45 -04:00
rodzic 31bc73a7b1
commit 450c930241
1 zmienionych plików z 9 dodań i 5 usunięć

Wyświetl plik

@ -288,11 +288,15 @@ const AttachmentIndicesWidget: React.FC<{
);
};
const CreaturePartEditor: React.FC<{
creature: CreatureSymbol;
onChange: (symbol: CreatureSymbol) => void;
function CreaturePartEditor<T extends CreatureSymbol>({
creature,
onChange,
idPrefix,
}: {
creature: T;
onChange: (symbol: T) => void;
idPrefix: string;
}> = ({ creature, onChange, idPrefix }) => {
}): JSX.Element {
const specs = creature.data.specs || {};
const getAttachmentIndex = (attachment: AttachedCreatureSymbol) => {
const index = creature.attachments.indexOf(attachment);
@ -410,7 +414,7 @@ const CreaturePartEditor: React.FC<{
})}
</>
);
};
}
const CreatureEditorWidget: React.FC<{
creature: CreatureSymbol;