import { Atom, useAtom } from "jotai"; import { Badge, ListGroup } from "react-bootstrap"; export interface IPerson { name: string; } export interface Props { personAtom: Atom; } export default function Person({ personAtom, splitBetweenAtom }: Props) { const [person] = useAtom(personAtom); const [splitBetween, setSplitBetween] = useAtom(splitBetweenAtom); const removeSelf = (_) => { setSplitBetween([...splitBetween.filter((x) => x != personAtom)]); }; return ( {person.name} × ); }