<?php
/// file: app/View/admin/settings/index.php

declare(strict_types=1);

/** @var array<string, string> $settings */
$s = static function (string $k, string $d = '') use ($settings): string {
    return $settings[$k] ?? $d;
};
?>
<h1 class="text-2xl font-semibold text-white">Site settings</h1>
<form method="post" action="<?= e(url('/admin/settings')) ?>" class="mt-8 max-w-xl space-y-4">
    <?= \App\Core\Csrf::field() ?>
    <div><label class="text-xs text-silver-500">Brand name</label><input name="brand_name" class="mt-1 w-full rounded border border-white/10 bg-charcoal px-3 py-2 text-white" value="<?= e($s('brand_name')) ?>"></div>
    <div><label class="text-xs text-silver-500">Tagline</label><input name="tagline" class="mt-1 w-full rounded border border-white/10 bg-charcoal px-3 py-2 text-white" value="<?= e($s('tagline')) ?>"></div>
    <div><label class="text-xs text-silver-500">Contact email</label><input name="contact_email" type="email" class="mt-1 w-full rounded border border-white/10 bg-charcoal px-3 py-2 text-white" value="<?= e($s('contact_email')) ?>"></div>
    <div><label class="text-xs text-silver-500">Instagram URL</label><input name="social_instagram" class="mt-1 w-full rounded border border-white/10 bg-charcoal px-3 py-2 text-white" value="<?= e($s('social_instagram')) ?>"></div>
    <div><label class="text-xs text-silver-500">LinkedIn URL</label><input name="social_linkedin" class="mt-1 w-full rounded border border-white/10 bg-charcoal px-3 py-2 text-white" value="<?= e($s('social_linkedin')) ?>"></div>
    <div><label class="text-xs text-silver-500">Default OG image path</label><input name="og_default_image" class="mt-1 w-full rounded border border-white/10 bg-charcoal px-3 py-2 text-white" value="<?= e($s('og_default_image')) ?>"></div>
    <div><label class="text-xs text-silver-500">Default placeholder (projects &amp; posts without cover)</label><input name="default_placeholder_image" class="mt-1 w-full rounded border border-white/10 bg-charcoal px-3 py-2 text-white" value="<?= e($s('default_placeholder_image', '/assets/images/placeholder.svg')) ?>"></div>
    <button type="submit" class="rounded-full bg-white px-6 py-2 text-xs font-semibold text-carbon">Save</button>
</form>
