diff --git a/components/CharacterUnit/index.tsx b/components/CharacterUnit/index.tsx index 05925d14..f2b3964f 100644 --- a/components/CharacterUnit/index.tsx +++ b/components/CharacterUnit/index.tsx @@ -1,11 +1,13 @@ import React, { useEffect, useState } from 'react' import { useRouter } from 'next/router' import { useSnapshot } from 'valtio' -import { useTranslation } from 'next-i18next' +import { Trans, useTranslation } from 'next-i18next' import classnames from 'classnames' +import Alert from '~components/Alert' import Button from '~components/Button' import CharacterHovercard from '~components/CharacterHovercard' +import CharacterModal from '~components/CharacterModal' import { ContextMenu, ContextMenuTrigger, @@ -23,6 +25,7 @@ import SettingsIcon from '~public/icons/Settings.svg' import type { SearchableObject } from '~types' import './index.scss' +import { Dialog } from '~components/Dialog' interface Props { gridCharacter?: GridCharacter @@ -30,6 +33,7 @@ interface Props { editable: boolean updateObject: (object: SearchableObject, position: number) => void updateUncap: (id: string, position: number, uncap: number) => void + removeCharacter: (id: string) => void } const CharacterUnit = (props: Props) => { @@ -49,6 +53,9 @@ const CharacterUnit = (props: Props) => { filled: props.gridCharacter !== undefined, }) + const [modalOpen, setModalOpen] = useState(false) + const [alertOpen, setAlertOpen] = useState(false) + const gridCharacter = props.gridCharacter const character = gridCharacter?.object @@ -115,22 +122,71 @@ const CharacterUnit = (props: Props) => { ) - const contextMenu = () => { - return props.editable && gridCharacter && gridCharacter.id ? ( - - -