sls/resources/views/components/interview/admin-settings-card.blade.php
kushal.saha b787f04914 refactor(UI): improve global screenshot capture and onboarding
- compact ui
- fix routing after toggling settings
2026-08-18 06:45:10 +00:00

76 lines
5.0 KiB
PHP

@php
$screenshotActive = \App\Models\Setting::get('enable_candidate_screenshots', '1') === '1';
$onboardingActive = \App\Models\Setting::get('onboarding_enabled', '1') === '1';
$isAdmin = Auth::check() && Auth::user()->isAdmin();
@endphp
<div class="mb-6 grid grid-cols-1 md:grid-cols-2 gap-3.5">
<!-- 1. Candidate System Screenshot Capture Option Card -->
<div class="bg-[#0e1422] border border-[#1b2233] rounded-xl p-4 flex flex-col justify-between hover:border-slate-700/60 transition-colors">
<div class="flex items-start gap-3">
<div class="w-8 h-8 rounded-lg bg-emerald-500/10 border border-emerald-500/25 flex items-center justify-center text-emerald-400 shrink-0 mt-0.5">
<i class="fa-solid fa-camera text-sm"></i>
</div>
<div class="flex-1 min-w-0">
<div class="flex items-center gap-2 flex-wrap mb-1">
<h4 class="text-xs font-bold text-white m-0">Screenshot Capture</h4>
@if($screenshotActive)
<x-pill variant="success" size="sm" icon="fa-solid fa-circle-check">Active</x-pill>
@else
<x-pill variant="danger" size="sm" icon="fa-solid fa-circle-xmark">Stopped</x-pill>
@endif
</div>
<p class="text-[11.5px] text-slate-400 m-0 leading-relaxed">
Captures candidate's desktop automatically on call start & tab switches.
</p>
</div>
@if($isAdmin)
<div class="flex items-center justify-end pt-2 border-t border-white/5">
<form action="{{ route('admin.settings.screenshot-toggle') }}" method="POST" class="flex items-center gap-2">
@csrf
<label class="relative inline-flex items-center cursor-pointer" title="{{ $screenshotActive ? 'Turn off screenshots' : 'Turn on screenshots' }}">
<input type="checkbox" name="enable_candidate_screenshots" value="1" onchange="this.form.submit()" {{ $screenshotActive ? 'checked' : '' }} class="sr-only peer">
<div class="w-8 h-4.5 bg-slate-800 border border-slate-700 peer-focus:outline-none rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-slate-300 after:border after:rounded-full after:h-3.5 after:w-3.5 after:transition-all peer-checked:bg-indigo-600 peer-checked:border-indigo-500"></div>
</label>
</form>
</div>
@endif
</div>
</div>
<!-- 2. Candidate Onboarding Option Card -->
<div class="bg-[#0e1422] border border-[#1b2233] rounded-xl p-3.5 flex flex-col justify-between gap-3 hover:border-slate-700/60 transition-colors">
<div class="flex items-start gap-3">
<div class="w-8 h-8 rounded-lg bg-indigo-500/10 border border-indigo-500/25 flex items-center justify-center text-indigo-400 shrink-0 mt-0.5">
<i class="fa-solid fa-user-check text-sm"></i>
</div>
<div class="flex-1 min-w-0">
<div class="flex items-center gap-2 flex-wrap mb-1">
<h4 class="text-xs font-bold text-white m-0">Candidate Onboarding</h4>
@if($onboardingActive)
<x-pill variant="success" size="sm" icon="fa-solid fa-circle-check">Active</x-pill>
@else
<x-pill variant="danger" size="sm" icon="fa-solid fa-circle-xmark">Disabled</x-pill>
@endif
</div>
<p class="text-[11.5px] text-slate-400 m-0 leading-relaxed">
Automatic provisioning checklist and one-click revocation.
</p>
</div>
@if($isAdmin)
<div class="flex items-center justify-end pt-2 border-t border-white/5">
<form action="{{ route('admin.settings.onboarding-toggle') }}" method="POST" class="flex items-center gap-2">
@csrf
<label class="relative inline-flex items-center cursor-pointer" title="{{ $onboardingActive ? 'Turn off onboarding' : 'Turn on onboarding' }}">
<input type="checkbox" name="onboarding_enabled" value="1" onchange="this.form.submit()" {{ $onboardingActive ? 'checked' : '' }} class="sr-only peer">
<div class="w-8 h-4.5 bg-slate-800 border border-slate-700 peer-focus:outline-none rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-slate-300 after:border after:rounded-full after:h-3.5 after:w-3.5 after:transition-all peer-checked:bg-indigo-600 peer-checked:border-indigo-500"></div>
</label>
</form>
</div>
@endif
</div>
</div>
</div>