Files
analytics/resources/views/components/export-button.blade.php
T

16 lines
894 B
PHP
Raw Normal View History

2026-03-24 21:12:21 +01:00
@props(['website', 'report', 'from' => null, 'to' => null])
@php
$params = ['report' => $report];
if ($from) $params['from'] = $from instanceof \Carbon\Carbon ? $from->toDateString() : $from;
if ($to) $params['to'] = $to instanceof \Carbon\Carbon ? $to->toDateString() : $to;
if (request('range')) $params['range'] = request('range');
@endphp
<a href="{{ route('export', [$website] + $params) }}"
class="inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg border border-gray-300 text-xs font-medium text-gray-600 bg-white hover:bg-gray-50 transition"
title="Export as CSV">
<svg class="w-3.5 h-3.5" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="M3 16.5v2.25A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75V16.5M16.5 12 12 16.5m0 0L7.5 12m4.5 4.5V3" /></svg>
CSV
</a>