extends Container

@export var entry: CartEntry

func _ready() -> void:
	update_info()
	
func update_info():
	%Label.text = "%s (%sg / %.2f€)" % [
		entry.article_info.text,
		entry.weight_grams,
		entry.price_cents / 100.0
	]

func _on_delete_button():
	Global.cart.pop_at(entry.cart_index)
	Global.cart_updated.emit()
