<?php
$checked = $args['checked'] ?? false;
?>

<label class="w-full inline-flex items-center cursor-pointer">
    <span class="flex-1">فقط کالاهای موجود</span>
    <input class="peer sr-only" type="checkbox" <?= $checked ? 'checked' : '' ?>/>
    <span class="w-[2.5em] h-[1.5em] bg-slate-100 rounded-full relative before:absolute before:w-[1em] before:h-[1em]
                before:top-1/2 before:-translate-y-1/2
                before:rounded-full before:transition before:bg-white before:translate-x-[-1.25em]
                peer-checked:before:bg-primary peer-checked:before:translate-x-[-0.25em]">
    </span>
</label>