'use client';

import { useState } from 'react';
import { BinnerContext } from './BinnerContext';
import { Bin } from '@/app/lib/bin.enum';
import { ParsedBarcode } from '@/app/lib/barcode';

export const BinnerProvider = ({ children }: Readonly<{ children: React.ReactNode }>) => {
    const [bin, setBin] = useState<Bin | null>(null);
    const [item, setItem] = useState<ParsedBarcode | null>(null);

    return (
        <BinnerContext.Provider value={{ bin, item, setBin, setItem }}>
            {children}
        </BinnerContext.Provider>
    );
};
