import { PrimitiveAtom, useAtom } from "jotai"; import { Badge, Card } from "react-bootstrap"; import { moneyFormatter } from "../lib/formatter"; import { receiptAtom } from "../lib/state"; import EditBox from "./EditBox"; import NumberEditBox from "./NumberEditBox"; import { IPerson } from "./Person"; import SplitBetween from "./SplitBetween"; export type Receipt = PrimitiveAtom[]; export interface IReceiptItem { name: PrimitiveAtom; price: PrimitiveAtom; splitBetween: PrimitiveAtom[]>; } export interface Props { itemAtom: PrimitiveAtom; } export default function ReceiptItem({ itemAtom }: Props) { const [receipt, setReceipt] = useAtom(receiptAtom); const [item, _] = useAtom(itemAtom); const removeSelf = (_: any) => { setReceipt([...receipt.filter((x) => x != itemAtom)]); }; return (

s} />

×
); }