<?php

namespace Devnet\EBC\Includes;

if (!defined('ABSPATH')) {
    exit;
}

class Defaults
{
    private static function format_output($options = [], $option_name = '')
    {
        $output = $options;

        if ($option_name) {
            $output = $options[$option_name] ?? null;
        }

        return $output;
    }

    public static function general($option_name = '')
    {
        $options = [
            'multilingual'       => 0,
            'only_logged_users'  => 0,
            'delete_plugin_data' => 0
        ];

        return self::format_output($options, $option_name);
    }

    public static function calendar($option_name = '')
    {
        $options = [
            'locale'            => 'default',
            'date_format'       => 'F j, Y',
            'open'              => 1,
            'title'             => esc_html__('Select a date', 'easy-booking-calendar'),
            'theme'             => '',
            'primary_color'     => '#8bc34a',
            'max_date_limit'    => '',
            'availability_mode' => '',
            'dates'             => ''
        ];

        return self::format_output($options, $option_name);
    }

    public static function product($option_name = '')
    {
        $options = [
            'booking_calculation_mode' => 'nights',
            'double_bookings'          => 0,
            'button_text'              => esc_html__('Book Now →', 'easy-booking-calendar'),
            'disable_quantity'         => 1
        ];

        return self::format_output($options, $option_name);
    }
}
