<?php

namespace Limb_Chatbot\Includes\Widgets\Data;

class Availability_Widget_Config extends Abstract_Widget_Config {
	public function sanitize( $data ): array {
		$data = is_array( $data ) ? $data : [];

		return [
			'status_text'   => $this->sanitize_string( $data['status_text'] ?? '' ),
			'response_time' => $this->sanitize_string( $data['response_time'] ?? '' ),
		];
	}

	public function validate( $data ): bool {
		return is_array( $data );
	}

	public function get_translatable_fields(): array {
		return [
			[ 'path' => 'status_text', 'type' => 'string' ],
			[ 'path' => 'response_time', 'type' => 'string' ],
		];
	}
}
