<?php
  $meta = [
    'title'=>'',
    'keywords'=>'',
    'description'=>'',
    'type'=>'website',
    'image'=>$page['props']['ziggy']['url']. "/image/logo.png",
  ];
  if(!empty($page['props']['meta']['title'])){
    $meta['title'] = $page['props']['meta']['title'];
  }
  if(!empty($page['props']['meta']['keywords'])){
    $meta['keywords'] = $page['props']['meta']['keywords'];
  }
  if(!empty($page['props']['meta']['description'])){
    $meta['description'] = $page['props']['meta']['description'];
  }
  if(!empty($page['props']['meta']['image'])){
    $meta['image'] = $page['props']['meta']['image'];
  }

  if(empty($meta['title']) && !empty($page['props']['default_meta']['companyName'])){
    $meta['title'] = $page['props']['default_meta']['companyName'];
  }
  if(empty($meta['description']) && !empty($page['props']['default_meta']['about'])){
    $meta['description'] = $page['props']['default_meta']['about'];
  }
  if(empty($meta['keywords']) && !empty($page['props']['default_meta']['seoKeywords'])){
    $meta['keywords'] = $page['props']['default_meta']['seoKeywords'];
  }
  if(empty($meta['description']) && !empty($page['props']['default_meta']['seoDescription'])){
    $meta['description'] = $page['props']['default_meta']['seoDescription'];
  }

  $title = $meta['title'];
  $keywords = $meta['keywords'];
  $description = $meta['description'];
  $type = $meta['type'];
  $image = $meta['image'];
  $ziggy = $page['props']['ziggy'];
  $appName = $page['props']['appName'];

  $currentUrl = url()->current();
  $googleVerification = $page['props']['config']['GOOGLE_VERIFICATION'] ?? null;
  // dd($googleVerification);
?>

<title inertia><?php echo e($title); ?></title>
<meta name="description" content="<?php echo e($description); ?>"/>
<meta name="twitter:description" content="<?php echo e($description); ?>"/>
<meta property="og:description" content="<?php echo e($description); ?>"/>

<meta name="keywords" content="<?php echo e($keywords); ?>"/>
<meta property="og:title" content="<?php echo e($title); ?>"/>
<meta property="og:url" content="<?php echo e($ziggy['location']); ?>"/>
<meta property="og:site_name" content="<?php echo e($appName); ?>"/>

<meta property="twitter:title" content="<?php echo e($title); ?>"/>
<meta property="twitter:url" content="<?php echo e($ziggy['location']); ?>"/>
<meta property="twitter:url" content="<?php echo e($ziggy['location']); ?>"/>
<meta property="twitter:domain" content="<?php echo e($appName); ?>"/>
<meta property="twitter:image" content="<?php echo e($image); ?>"/>
<meta name="twitter:card" content="summary_large_image"/>

<meta property="og:image" content="<?php echo e($image); ?>"/>
<meta property="og:image:url" content="<?php echo e($image); ?>"/>
<meta property="og:image:size" content="300"/>
<meta property="og:type" content="<?php echo e($type); ?>"/>

<link rel="icon" type="image/png" href="<?php echo e($ziggy['url'] ."/image/icon.png"); ?>">

<?php if(!empty($googleVerification)): ?>
    <meta name="google-site-verification" content="<?php echo e($googleVerification); ?>" />
<?php endif; ?><?php /**PATH C:\Alim\DEV_Project\dev-project-laravel\resources\views/components/meta.blade.php ENDPATH**/ ?>