Forms\Components\TextInput::make('amount')
->required()
->reactive()
->default($this->total)
->label(__('Amount'))
->afterStateUpdated(fn (\Closure $set, $state) => $set('debt', $this->total - $state))
->mask(fn (Forms\Components\TextInput\Mask $mask) => $mask->money(prefix: 'Rp ', thousandsSeparator: '.', decimalPlaces: 0)),
Forms\Components\Select::make('product_id')
->options(fn () => $this->items->pluck('name', 'id')->toArray())
->label(__('Select in debt item'))
->required(fn (\Closure $get) => $get('amount') < $this->total)
->hidden(fn (\Closure $get) => $get('amount') >= $this->total),
Forms\Components\TextInput::make('debt')
->label(__('Debt'))
->hidden(fn (\Closure $get) => $get('amount') >= $this->total)
->mask(fn (Forms\Components\TextInput\Mask $mask) => $mask->money(prefix: 'Rp ', thousandsSeparator: '.', decimalPlaces: 0)),
Forms\Components\TextInput::make('amount')
->required()
->reactive()
->default($this->total)
->label(__('Amount'))
->afterStateUpdated(fn (\Closure $set, $state) => $set('debt', $this->total - $state))
->mask(fn (Forms\Components\TextInput\Mask $mask) => $mask->money(prefix: 'Rp ', thousandsSeparator: '.', decimalPlaces: 0)),
Forms\Components\Select::make('product_id')
->options(fn () => $this->items->pluck('name', 'id')->toArray())
->label(__('Select in debt item'))
->required(fn (\Closure $get) => $get('amount') < $this->total)
->hidden(fn (\Closure $get) => $get('amount') >= $this->total),
Forms\Components\TextInput::make('debt')
->label(__('Debt'))
->hidden(fn (\Closure $get) => $get('amount') >= $this->total)
->mask(fn (Forms\Components\TextInput\Mask $mask) => $mask->money(prefix: 'Rp ', thousandsSeparator: '.', decimalPlaces: 0)),