Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
ArgentumHeart committed Dec 14, 2024
2 parents 6ea7566 + b79ccd6 commit 02e154e
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/renderer/components/Item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { grey, lightBlue } from '@mui/material/colors';
import Avatar from '@mui/material/Avatar';
import { useItemContext } from '../contexts/itemsContext';
import { TItem } from '../../types';
import { EvoItemRenderer } from './ItemWithTooltip';

interface EvoItemProps extends BoxProps {
item: TItem
Expand Down Expand Up @@ -40,6 +41,7 @@ export function EvoItem(props: EvoItemProps) {
</Typography>
))}
<ItemDependenciesTree item={item} />
<CraftsIntoItemList item={item} />
</Box>
)
}
Expand All @@ -61,6 +63,21 @@ function ItemDependenciesTree(props: {item: TItem}) {
)
}

function CraftsIntoItemList(props: {item: TItem}) {
const { item } = props;
if (item.partOf?.length === 0) return null;
return (
<Box sx={{ width: '500px', paddingTop: '15px'}}>
<Typography variant="h6">Crafts into</Typography>
<Box sx={{ display: 'flex', flexWrap: 'wrap', paddingTop: '20px' }}>
{item.partOf?.map((id) => (
<EvoItemRenderer key={id} id={id} />
))}
</Box>
</Box>
)
}

function ItemDependency(props: {id: string; index: string;}) {
const { items } = useItemContext();
const { id, index } = props;
Expand Down

0 comments on commit 02e154e

Please sign in to comment.