Finished translations / bug fixes
This commit is contained in:
@@ -2,10 +2,11 @@ import { FC, HTMLProps, memo, useMemo } from 'react'
|
||||
import { EnrichedEntity } from '../../../src/types'
|
||||
import styles from './EntitySpan.module.css'
|
||||
import { RecipeSpan } from '../Recipe/Recipe'
|
||||
import { LeftClickIcon } from '../LeftClickIcon/LeftClickIcon'
|
||||
import { LeftClickIcon } from '../../icons/LeftClickIcon'
|
||||
import cx from 'classnames'
|
||||
import { EntityIcon } from '../EntityIcon/EntityIcon'
|
||||
import { useFactories } from '../../contexts/FactoryProvider'
|
||||
import { I18n } from '../../shared/I18n/I18n'
|
||||
|
||||
interface Props extends Omit<HTMLProps<HTMLSpanElement>, 'value'> {
|
||||
value: EnrichedEntity | string
|
||||
@@ -16,7 +17,7 @@ interface Props extends Omit<HTMLProps<HTMLSpanElement>, 'value'> {
|
||||
className?: string
|
||||
}
|
||||
|
||||
const EntitySpanUnmemo: FC<Props> = ({
|
||||
const EntitySpanBase: FC<Props> = ({
|
||||
className,
|
||||
value,
|
||||
state,
|
||||
@@ -50,13 +51,17 @@ const EntitySpanUnmemo: FC<Props> = ({
|
||||
<div className={styles.tooltip}>
|
||||
{entity.recipe && (
|
||||
<>
|
||||
<div className={styles.strong}>Recipe</div>
|
||||
<div className={styles.strong}>
|
||||
<I18n id={'page.home.tooltip.recipe'} />
|
||||
</div>
|
||||
<RecipeSpan recipe={entity.recipe} />
|
||||
</>
|
||||
)}
|
||||
{entity.usedBy?.length ? (
|
||||
<>
|
||||
<div className={styles.strong}>Used By</div>
|
||||
<div className={styles.strong}>
|
||||
<I18n id={'page.home.tooltip.used_by'} />
|
||||
</div>
|
||||
<div className={styles.usedBy}>
|
||||
{entity.usedBy.map(used => (
|
||||
<EntityIcon value={used} key={used.name} />
|
||||
@@ -66,7 +71,9 @@ const EntitySpanUnmemo: FC<Props> = ({
|
||||
) : null}
|
||||
{(leftClickText || rightClickText) && (
|
||||
<>
|
||||
<div className={styles.strong}>Actions</div>
|
||||
<div className={styles.strong}>
|
||||
<I18n id={'page.home.tooltip.actions'} />
|
||||
</div>
|
||||
{leftClickText && (
|
||||
<div>
|
||||
<LeftClickIcon className={styles.leftClick} classClick={styles.clickBtn} />{' '}
|
||||
@@ -86,4 +93,4 @@ const EntitySpanUnmemo: FC<Props> = ({
|
||||
)
|
||||
}
|
||||
|
||||
export const EntitySpan = memo(EntitySpanUnmemo)
|
||||
export const EntitySpan = memo(EntitySpanBase)
|
||||
|
||||
Reference in New Issue
Block a user