<?php

namespace Growfund\Views\Components\Comments;

use Growfund\DTO\Comment\CommentDTO;
use Growfund\View;

defined( 'ABSPATH' ) || exit;

class Comment extends View {
    /** @var CommentDTO */
    public $comment;

    protected function get_template_dir() {
        return 'site/components/comments';
    }

    protected function enqueue_styles()
    {
        $main_styles_url = GROWFUND_DIR_URL . 'resources/assets/site/styles/components/comments/comment.css';

        wp_enqueue_style(
            'growfund-comment-styles',
            $main_styles_url,
            ['growfund-main-styles'],
            GROWFUND_VERSION
        );
    }

    protected function enqueue_scripts()
    {
        $script_url = GROWFUND_DIR_URL . 'resources/assets/site/scripts/components/comments/comment.js';
        wp_enqueue_script('growfund-comment-script', $script_url, ['growfund-core'], GROWFUND_VERSION, true);
    }

    public $casts = [
        'comment' => CommentDTO::class
    ];
}
