<?= $this->extend('admin/layout/main') ?>
<?= $this->section('content') ?>
<div class="d-flex justify-content-between align-items-center mb-3">
    <h3><?= lang('App.companies') ?></h3>
    <a href="/admin/companies/create" class="btn btn-dark btn-sm"><?= lang('App.add_new') ?></a>
</div>
<div class="card p-3">
<table class="table">
    <thead><tr><th><?= lang('App.name') ?></th><th><?= lang('App.base_currency') ?></th><th><?= lang('App.email') ?></th><th><?= lang('App.status') ?></th><th><?= lang('App.actions') ?></th></tr></thead>
    <tbody>
    <?php foreach ($companies as $c): ?>
        <tr>
            <td><?= esc($c['name']) ?></td>
            <td><?= esc($c['base_currency']) ?></td>
            <td><?= esc($c['email']) ?></td>
            <td><?= $c['is_active'] ? '✅' : '❌' ?></td>
            <td><a href="/admin/companies/<?= $c['id'] ?>/edit" class="btn btn-sm btn-outline-primary"><?= lang('App.edit') ?></a></td>
        </tr>
    <?php endforeach; ?>
    </tbody>
</table>
</div>
<?= $this->endSection() ?>
