38 lines
734 B
TypeScript
38 lines
734 B
TypeScript
import React, { FC } from "react";
|
|
import { Box } from "@chakra-ui/react";
|
|
|
|
import { ListLPItem } from "components/TokenInput";
|
|
import { useClawDEX } from "modules/common";
|
|
|
|
type Props = {
|
|
onClick: (v: string) => void;
|
|
};
|
|
|
|
const ListLP: FC<Props> = ({ onClick }) => {
|
|
const { pools } = useClawDEX();
|
|
|
|
if (pools == null) {
|
|
return null;
|
|
}
|
|
|
|
return (
|
|
<Box>
|
|
<Box h="xs" overflowY="auto" px="2" mt="2">
|
|
<Box>
|
|
{pools.map((pool) => {
|
|
return (
|
|
<ListLPItem
|
|
key={pool.pool_address}
|
|
pool={pool}
|
|
onClick={onClick}
|
|
/>
|
|
);
|
|
})}
|
|
</Box>
|
|
</Box>
|
|
</Box>
|
|
);
|
|
};
|
|
|
|
export default ListLP;
|