Skip to content

armgit / mimik

Public Imported from GitHub
0

🎬 A browser extension and desktop app that turns your clicks into step-by-step guides with annotated screenshots 📖

feat(export): add branding settings for logo, footer line and attribution

Luis Ortized8040a4ca98
diff --git a/public/mimik-mark.png b/public/mimik-mark.png
new file mode 100644
index 0000000..86d7cbc
Binary files /dev/null and b/public/mimik-mark.png differ
diff --git a/src/core/export/__tests__/branding.test.ts b/src/core/export/__tests__/branding.test.ts
new file mode 100644
index 0000000..f465adc
--- /dev/null
+++ b/src/core/export/__tests__/branding.test.ts
@@ -0,0 +1,106 @@
+import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
+import { fakeBrowser } from 'wxt/testing';
+import { dataUrlToBytes, defaultFooterLine, fitLogo, loadBranding } from '@/core/export/branding';
+import { DEFAULT_TARGET_COLOR } from '@/core/screenshot/types';
+
+describe('loadBranding', () => {
+ beforeEach(() => {
+ fakeBrowser.reset();
+ vi.stubGlobal(
+ 'fetch',
+ vi.fn(() => Promise.reject(new Error('no packaged asset in tests'))),
+ );
+ });
+
+ afterEach(() => {
+ vi.unstubAllGlobals();
+ });
+
+ it('prefills the footer and defaults the accent when storage is empty', async () => {
+ const brand = await loadBranding();
+ expect(brand).toEqual({
+ logo: null,
+ footer: defaultFooterLine(),
+ attribution: true,
+ accent: DEFAULT_TARGET_COLOR,
+ custom: false,
+ });
+ });
+
+ it('respects a footer the user has deliberately cleared', async () => {
+ await fakeBrowser.storage.local.set({ brandFooter: '' });
+ expect((await loadBranding()).footer).toBe('');
+ });
+
+ it('normalises a shorthand accent and flags it as custom', async () => {
+ await fakeBrowser.storage.local.set({ targetColor: '#f43' });
+ const brand = await loadBranding();
+ expect(brand.accent).toBe('#FF4433');
+ expect(brand.custom).toBe(true);
+ });
+
+ it('ignores an unparseable accent rather than emitting it into the document', async () => {
+ await fakeBrowser.storage.local.set({ targetColor: 'not-a-colour' });
+ const brand = await loadBranding();
+ expect(brand.accent).toBe(DEFAULT_TARGET_COLOR);
+ expect(brand.custom).toBe(false);
+ });
+
+ it('treats the default accent as not custom so the stock palette is preserved', async () => {
+ await fakeBrowser.storage.local.set({ targetColor: DEFAULT_TARGET_COLOR.toLowerCase() });
+ const brand = await loadBranding();
+ expect(brand.custom).toBe(false);
+ });
+
+ it('trims the footer line and keeps attribution on unless explicitly disabled', async () => {
+ await fakeBrowser.storage.local.set({ brandFooter: ' Confidential ' });
+ expect((await loadBranding()).footer).toBe('Confidential');
+ expect((await loadBranding()).attribution).toBe(true);
+
+ await fakeBrowser.storage.local.set({ brandAttribution: false });
+ expect((await loadBranding()).attribution).toBe(false);
+ });
+
+ it('rejects a malformed stored logo instead of rendering a broken image', async () => {
+ for (const brandLogo of [
+ { dataUrl: 'https://example.com/logo.png', width: 10, height: 10 },
+ { dataUrl: 'data:image/png;base64,AAA', width: 0, height: 10 },
+ { dataUrl: 'data:image/png;base64,AAA' },
+ 'not-an-object',
+ ]) {
+ await fakeBrowser.storage.local.set({ brandLogo });
+ expect((await loadBranding()).logo).toBeNull();
+ }
+ });
+
+ it('accepts a well-formed stored logo and does not reach for the Mimik fallback', async () => {
+ const brandLogo = { dataUrl: 'data:image/png;base64,AAA', width: 320, height: 80 };
+ await fakeBrowser.storage.local.set({ brandLogo });
+ expect((await loadBranding()).logo).toEqual(brandLogo);
+ expect(fetch).not.toHaveBeenCalled();
+ });
+
+ it('reaches for the packaged Mimik fallback when no logo is stored', async () => {
+ await loadBranding();
+ expect(fetch).toHaveBeenCalledTimes(1);
+ expect(String(vi.mocked(fetch).mock.calls[0][0])).toContain('mimik-mark.png');
+ });
+});
+
+describe('fitLogo', () => {
+ it('scales down to fit the tighter of the two bounds', () => {
+ expect(fitLogo({ dataUrl: 'x', width: 400, height: 100 }, 200, 80)).toEqual({ width: 200, height: 50 });
+ expect(fitLogo({ dataUrl: 'x', width: 100, height: 400 }, 200, 80)).toEqual({ width: 20, height: 80 });
+ });
+
+ it('never upscales a small logo', () => {
+ expect(fitLogo({ dataUrl: 'x', width: 40, height: 20 }, 200, 80)).toEqual({ width: 40, height: 20 });
+ });
+});
+
+describe('dataUrlToBytes', () => {
+ it('decodes the base64 payload after the comma', () => {
+ const dataUrl = `data:image/png;base64,${btoa('PNG-ish')}`;
+ expect(new TextDecoder().decode(dataUrlToBytes(dataUrl))).toBe('PNG-ish');
+ });
+});
diff --git a/src/core/export/branding.ts b/src/core/export/branding.ts
new file mode 100644
index 0000000..18444b9
--- /dev/null
+++ b/src/core/export/branding.ts
@@ -0,0 +1,87 @@
+import { blobToDataUrl } from '@/core/export/utils';
+import { normalizeHex } from '@/core/screenshot/color';
+import { DEFAULT_TARGET_COLOR } from '@/core/screenshot/types';
+import { getExtensionURL, localStorage } from '@/lib/browser-api';
+
+export const BRAND_LOGO_MAX_WIDTH = 320;
+const FALLBACK_LOGO_PATH = '/mimik-mark.png';
+
+export const defaultFooterLine = () => `© ${new Date().getFullYear()}`;
+
+export interface BrandLogo {
+ dataUrl: string;
+ width: number;
+ height: number;
+}
+
+export interface Branding {
+ logo: BrandLogo | null;
+ footer: string;
+ attribution: boolean;
+ accent: string;
+ custom: boolean;
+}
+
+function parseLogo(value: unknown): BrandLogo | null {
+ if (!value || typeof value !== 'object') return null;
+ const { dataUrl, width, height } = value as Partial<BrandLogo>;
+ if (typeof dataUrl !== 'string' || !dataUrl.startsWith('data:')) return null;
+ if (typeof width !== 'number' || typeof height !== 'number' || width <= 0 || height <= 0) return null;
+ return { dataUrl, width, height };
+}
+
+async function loadFallbackLogo(): Promise<BrandLogo | null> {
+ try {
+ const response = await fetch(getExtensionURL(FALLBACK_LOGO_PATH));
+ if (!response.ok) return null;
+ const blob = await response.blob();
+ const bitmap = await createImageBitmap(blob);
+ const logo = { dataUrl: await blobToDataUrl(blob), width: bitmap.width, height: bitmap.height };
+ bitmap.close?.();
+ return logo;
+ } catch {
+ return null;
+ }
+}
+
+export async function loadBranding(): Promise<Branding> {
+ const stored = await localStorage.get(['brandLogo', 'brandFooter', 'brandAttribution', 'targetColor']);
+ const accent = (typeof stored.targetColor === 'string' && normalizeHex(stored.targetColor)) || DEFAULT_TARGET_COLOR;
+ return {
+ logo: parseLogo(stored.brandLogo) ?? (await loadFallbackLogo()),
+ footer: typeof stored.brandFooter === 'string' ? stored.brandFooter.trim() : defaultFooterLine(),
+ attribution: stored.brandAttribution !== false,
+ accent,
+ custom: accent !== DEFAULT_TARGET_COLOR,
+ };
+}
+
+export function fitLogo(logo: BrandLogo, maxWidth: number, maxHeight: number): { width: number; height: number } {
+ const scale = Math.min(maxWidth / logo.width, maxHeight / logo.height, 1);
+ return {
+ width: Math.max(1, Math.round(logo.width * scale)),
+ height: Math.max(1, Math.round(logo.height * scale)),
+ };
+}
+
+export function dataUrlToBytes(dataUrl: string): Uint8Array {
+ const binary = atob(dataUrl.slice(dataUrl.indexOf(',') + 1));
+ const bytes = new Uint8Array(binary.length);
+ for (let i = 0; i < binary.length; i++) bytes[i] = binary.charCodeAt(i);
+ return bytes;
+}
+
+export async function makeBrandLogo(file: File): Promise<BrandLogo> {
+ const bitmap = await createImageBitmap(file);
+ const scale = Math.min(1, BRAND_LOGO_MAX_WIDTH / bitmap.width);
+ const width = Math.max(1, Math.round(bitmap.width * scale));
+ const height = Math.max(1, Math.round(bitmap.height * scale));
+ const canvas = document.createElement('canvas');
+ canvas.width = width;
+ canvas.height = height;
+ const ctx = canvas.getContext('2d');
+ if (!ctx) throw new Error('no 2d context');
+ ctx.drawImage(bitmap, 0, 0, width, height);
+ bitmap.close?.();
+ return { dataUrl: canvas.toDataURL('image/png'), width, height };
+}
diff --git a/src/locales/de.yml b/src/locales/de.yml
index 33c6be7..1dca2b0 100644
--- a/src/locales/de.yml
+++ b/src/locales/de.yml
@@ -46,7 +46,6 @@ guideme:
manualStep: "Dieser Schritt wurde bearbeitet und kann nicht automatisch erkannt werden. Nutze Weiter, wenn du fertig bist."
roadblock: "Wir kommen nicht weiter. Führe die Aktion auf dem Bildschirm aus, um fortzufahren."
live: Live
- stepOf: "Schritt $1 von $2"
noDescription: Keine Beschreibung
prev: Zurück
next: Weiter
@@ -79,8 +78,20 @@ recording:
minutesAgo: "vor $1 Min."
settings:
- targetColorHint: "Standard für neu aufgenommene Schritte"
- targetColor: "Farbe des Klickziels"
+ targetColorHint: "Klick-Hervorhebungen und Export-Akzente"
+ branding: "Export-Branding"
+ brandLogo: "Logo"
+ brandLogoHint: "Erscheint auf dem Deckblatt jedes Exports. Transparentes PNG empfohlen."
+ uploadLogo: "Logo hochladen"
+ replaceLogo: "Ersetzen"
+ removeLogo: "Logo entfernen"
+ footerLine: "Fußzeile"
+ footerLinePlaceholder: "z. B. Vertraulich — nur intern"
+ footerPresetConfidential: "Vertraulich — nur intern"
+ footerPresetNoDistribute: "Nicht weitergeben"
+ attribution: '"Made with Mimik" anzeigen'
+ attributionHint: "In der Fußzeile jedes Exports"
+ targetColor: "Markenfarbe"
title: Einstellungen
aiDescriptions: KI-Beschreibungen
provider: Anbieter
@@ -216,6 +227,7 @@ steps:
defaultAction: "$1 $2"
export:
+ madeWith: "Made with Mimik"
created: Erstellt
source: Quelle
step: Schritt
diff --git a/src/locales/en.yml b/src/locales/en.yml
index 31aec9a..10c1f59 100644
--- a/src/locales/en.yml
+++ b/src/locales/en.yml
@@ -46,7 +46,6 @@ guideme:
live: Live
roadblock: "We hit a roadblock. Try taking action on the screen to move forward."
manualStep: "This step was edited, so it can't be detected automatically. Use Next once you've done it."
- stepOf: "Step $1 of $2"
noDescription: No description
prev: Prev
next: Next
@@ -85,8 +84,20 @@ settings:
model: Model
apiKey: API Key
aiLanguage: Description Language
- targetColor: "Click target colour"
- targetColorHint: "Default for newly captured steps"
+ targetColor: "Brand colour"
+ targetColorHint: "Click highlights and export accents"
+ branding: "Export Branding"
+ brandLogo: "Logo"
+ brandLogoHint: "Shown on the cover of every export. Transparent PNG recommended."
+ uploadLogo: "Upload logo"
+ replaceLogo: "Replace"
+ removeLogo: "Remove logo"
+ footerLine: "Footer line"
+ footerLinePlaceholder: "e.g. Confidential — internal use only"
+ footerPresetConfidential: "Confidential — internal use only"
+ footerPresetNoDistribute: "Do not distribute"
+ attribution: 'Show "Made with Mimik"'
+ attributionHint: "In the footer of every export"
saveSettings: Save Settings
saved: Saved
smartBlur: Smart Blur
@@ -284,6 +295,7 @@ steps:
defaultAction: "$1 $2"
export:
+ madeWith: "Made with Mimik"
created: Created
source: Source
step: Step
diff --git a/src/locales/es.yml b/src/locales/es.yml
index d269d7e..60e187f 100644
--- a/src/locales/es.yml
+++ b/src/locales/es.yml
@@ -46,7 +46,6 @@ guideme:
live: En vivo
roadblock: "Nos encontramos con un obstáculo. Actúa en la pantalla para avanzar."
manualStep: "Este paso fue editado, así que no se puede detectar automáticamente. Usa Siguiente cuando lo hayas hecho."
- stepOf: "Paso $1 de $2"
noDescription: Sin descripción
prev: Anterior
next: Siguiente
@@ -85,8 +84,20 @@ settings:
model: Modelo
apiKey: Clave API
aiLanguage: Idioma de descripciones
- targetColor: "Color del objetivo de clic"
- targetColorHint: "Predeterminado para pasos nuevos"
+ targetColor: "Color de marca"
+ targetColorHint: "Resaltados de clic y acentos de exportación"
+ branding: "Marca en exportaciones"
+ brandLogo: "Logotipo"
+ brandLogoHint: "Aparece en la portada de cada exportación. Se recomienda PNG transparente."
+ uploadLogo: "Subir logotipo"
+ replaceLogo: "Reemplazar"
+ removeLogo: "Quitar logotipo"
+ footerLine: "Línea de pie de página"
+ footerLinePlaceholder: "p. ej. Confidencial — solo uso interno"
+ footerPresetConfidential: "Confidencial — solo uso interno"
+ footerPresetNoDistribute: "No distribuir"
+ attribution: 'Mostrar "Made with Mimik"'
+ attributionHint: "En el pie de cada exportación"
saveSettings: Guardar ajustes
saved: Guardado
smartBlur: Desenfoque inteligente
@@ -284,6 +295,7 @@ steps:
defaultAction: "$1 $2"
export:
+ madeWith: "Made with Mimik"
created: Creado
source: Fuente
step: Paso
diff --git a/src/locales/fr.yml b/src/locales/fr.yml
index 0c01d44..aa2ef00 100644
--- a/src/locales/fr.yml
+++ b/src/locales/fr.yml
@@ -46,7 +46,6 @@ guideme:
live: En direct
roadblock: "Nous avons rencontré un obstacle. Agissez à l'écran pour continuer."
manualStep: "Cette étape a été modifiée, elle ne peut donc pas être détectée automatiquement. Utilisez Suivant une fois faite."
- stepOf: "Étape $1 sur $2"
noDescription: Aucune description
prev: "Préc."
next: Suiv.
@@ -85,8 +84,20 @@ settings:
model: "Modèle"
apiKey: "Clé API"
aiLanguage: Langue des descriptions
- targetColor: "Couleur de la cible de clic"
- targetColorHint: "Par défaut pour les nouvelles étapes"
+ targetColor: "Couleur de marque"
+ targetColorHint: "Surbrillance des clics et accents des exports"
+ branding: "Image de marque des exports"
+ brandLogo: "Logo"
+ brandLogoHint: "Affiché sur la couverture de chaque export. PNG transparent recommandé."
+ uploadLogo: "Téléverser un logo"
+ replaceLogo: "Remplacer"
+ removeLogo: "Supprimer le logo"
+ footerLine: "Ligne de pied de page"
+ footerLinePlaceholder: "p. ex. Confidentiel — usage interne"
+ footerPresetConfidential: "Confidentiel — usage interne"
+ footerPresetNoDistribute: "Ne pas diffuser"
+ attribution: 'Afficher « Made with Mimik »'
+ attributionHint: "Dans le pied de chaque export"
saveSettings: "Enregistrer"
saved: "Enregistré"
smartBlur: Flou intelligent
@@ -284,6 +295,7 @@ steps:
defaultAction: "$1 $2"
export:
+ madeWith: "Made with Mimik"
created: "Créé"
source: Source
step: "Étape"
diff --git a/src/locales/pt-BR.yml b/src/locales/pt-BR.yml
index 392298e..e0b7489 100644
--- a/src/locales/pt-BR.yml
+++ b/src/locales/pt-BR.yml
@@ -46,7 +46,6 @@ guideme:
live: Ao vivo
roadblock: "Encontramos um obstáculo. Aja na tela para avançar."
manualStep: "Esta etapa foi editada, então não pode ser detectada automaticamente. Use Próximo quando terminar."
- stepOf: "Passo $1 de $2"
noDescription: Sem descrição
prev: Anterior
next: Próximo
@@ -85,8 +84,20 @@ settings:
model: Modelo
apiKey: Chave da API
aiLanguage: "Idioma das descrições"
- targetColor: "Cor do alvo de clique"
- targetColorHint: "Padrão para novas etapas"
+ targetColor: "Cor da marca"
+ targetColorHint: "Destaques de clique e acentos da exportação"
+ branding: "Marca nas exportações"
+ brandLogo: "Logotipo"
+ brandLogoHint: "Aparece na capa de cada exportação. PNG transparente recomendado."
+ uploadLogo: "Enviar logotipo"
+ replaceLogo: "Substituir"
+ removeLogo: "Remover logotipo"
+ footerLine: "Linha de rodapé"
+ footerLinePlaceholder: "ex.: Confidencial — uso interno"
+ footerPresetConfidential: "Confidencial — uso interno"
+ footerPresetNoDistribute: "Não distribuir"
+ attribution: 'Mostrar "Made with Mimik"'
+ attributionHint: "No rodapé de cada exportação"
saveSettings: Salvar ajustes
saved: Salvo
smartBlur: Desfoque inteligente
@@ -284,6 +295,7 @@ steps:
defaultAction: "$1 $2"
export:
+ madeWith: "Made with Mimik"
created: Criado
source: Origem
step: Passo
diff --git a/src/ui/shared/SettingsView.tsx b/src/ui/shared/SettingsView.tsx
index fde0dee..431214c 100644
--- a/src/ui/shared/SettingsView.tsx
+++ b/src/ui/shared/SettingsView.tsx
@@ -6,16 +6,19 @@ import {
ChevronRight,
EyeOff,
Globe,
+ ImageIcon,
Shield,
Sparkles,
Star,
Target,
+ Trash2,
} from 'lucide-react';
-import { useEffect, useState } from 'react';
+import { useEffect, useRef, useState } from 'react';
import { i18n } from '#imports';
import { PRESET_LABELS, type PresetKey } from '@/core/blur/regexes';
import { AI_PROVIDERS, type AIProviderKey } from '@/core/capture/ai/models';
import { AI_LANGUAGES, type AILanguageCode } from '@/core/capture/ai/prompts';
+import { type BrandLogo, defaultFooterLine, makeBrandLogo } from '@/core/export/branding';
import { DEFAULT_TARGET_COLOR, TARGET_COLORS } from '@/core/screenshot/types';
import { localStorage } from '@/lib/browser-api';
import { Button } from '@/ui/components/ui/button';
@@ -28,6 +31,12 @@ interface SettingsViewProps {
onBack?: () => void;
}
+const FOOTER_PRESETS = () => [
+ defaultFooterLine(),
+ i18n.t('settings.footerPresetConfidential'),
+ i18n.t('settings.footerPresetNoDistribute'),
+];
+
export default function SettingsView({ onBack }: SettingsViewProps) {
const [provider, setProvider] = useState<AIProviderKey>('openai');
const [model, setModel] = useState(AI_PROVIDERS.openai.defaultModel);
@@ -35,6 +44,10 @@ export default function SettingsView({ onBack }: SettingsViewProps) {
const [saved, setSaved] = useState(false);
const [aiLanguage, setAiLanguage] = useState<AILanguageCode>('en');
const [targetColor, setTargetColor] = useState<string>(DEFAULT_TARGET_COLOR);
+ const [brandLogo, setBrandLogo] = useState<BrandLogo | null>(null);
+ const [brandFooter, setBrandFooter] = useState('');
+ const [brandAttribution, setBrandAttribution] = useState(true);
+ const logoInputRef = useRef<HTMLInputElement>(null);
const [blurPresets, setBlurPresets] = useState<Record<PresetKey, boolean>>({
email: true,
phone: true,
@@ -46,7 +59,17 @@ export default function SettingsView({ onBack }: SettingsViewProps) {
useEffect(() => {
localStorage
- .get(['aiApiKey', 'aiProvider', 'aiModel', 'aiLanguage', 'blurPresets', 'targetColor'])
+ .get([
+ 'aiApiKey',
+ 'aiProvider',
+ 'aiModel',
+ 'aiLanguage',
+ 'blurPresets',
+ 'targetColor',
+ 'brandLogo',
+ 'brandFooter',
+ 'brandAttribution',
+ ])
.then((result) => {
const p = (result.aiProvider as AIProviderKey) || 'openai';
setProvider(p);
@@ -55,9 +78,17 @@ export default function SettingsView({ onBack }: SettingsViewProps) {
if (result.aiLanguage) setAiLanguage(result.aiLanguage as AILanguageCode);
if (result.blurPresets) setBlurPresets(result.blurPresets as Record<PresetKey, boolean>);
if (result.targetColor) setTargetColor(result.targetColor as string);
+ if (result.brandLogo) setBrandLogo(result.brandLogo as BrandLogo);
+ setBrandFooter(typeof result.brandFooter === 'string' ? result.brandFooter : defaultFooterLine());
+ if (result.brandAttribution === false) setBrandAttribution(false);
});
}, []);
+ const handleLogoPick = async (file: File | undefined) => {
+ if (!file) return;
+ setBrandLogo(await makeBrandLogo(file));
+ };
+
const handleProviderChange = (newProvider: AIProviderKey) => {
setProvider(newProvider);
setModel(AI_PROVIDERS[newProvider].defaultModel);
@@ -71,6 +102,9 @@ export default function SettingsView({ onBack }: SettingsViewProps) {
aiLanguage,
blurPresets,
targetColor,
+ brandLogo,
+ brandFooter,
+ brandAttribution,
});
setSaved(true);
setTimeout(() => setSaved(false), 2000);
@@ -146,7 +180,13 @@ export default function SettingsView({ onBack }: SettingsViewProps) {
<div>
<label className="block text-[11px] font-semibold text-foreground mb-1">{i18n.t('settings.apiKey')}</label>
- <Input type="password" value={apiKey} onChange={(e) => setApiKey(e.target.value)} placeholder="sk-..." />
+ <Input
+ type="password"
+ value={apiKey}
+ onChange={(e) => setApiKey(e.target.value)}
+ placeholder="sk-..."
+ className="h-8 text-[12px] rounded-lg border-border"
+ />
</div>
<div>
@@ -199,6 +239,101 @@ export default function SettingsView({ onBack }: SettingsViewProps) {
</Popover>
</div>
+ <div className="border border-border rounded-[10px] p-3.5 space-y-3">
+ <div className="flex items-center gap-2.5">
+ <div className="w-7 h-7 rounded-lg bg-secondary flex items-center justify-center">
+ <ImageIcon size={14} className="text-accent" />
+ </div>
+ <span className="text-xs font-bold text-foreground">{i18n.t('settings.branding')}</span>
+ </div>
+
+ <div>
+ <label className="block text-[11px] font-semibold text-foreground mb-1">
+ {i18n.t('settings.brandLogo')}
+ </label>
+ <p className="text-[10px] text-muted-foreground mb-2">{i18n.t('settings.brandLogoHint')}</p>
+ <input
+ ref={logoInputRef}
+ type="file"
+ accept="image/png,image/jpeg,image/svg+xml,image/webp"
+ className="hidden"
+ onChange={(e) => handleLogoPick(e.target.files?.[0])}
+ />
+ <div className="flex items-center gap-2.5">
+ {brandLogo && (
+ <img
+ src={brandLogo.dataUrl}
+ alt=""
+ className="h-9 max-w-[92px] object-contain rounded border border-border bg-secondary p-1"
+ />
+ )}
+ <button
+ type="button"
+ onClick={() => logoInputRef.current?.click()}
+ className="border border-border rounded-lg px-2.5 py-1.5 text-[11px] font-medium text-foreground hover:border-accent transition-colors"
+ >
+ {brandLogo ? i18n.t('settings.replaceLogo') : i18n.t('settings.uploadLogo')}
+ </button>
+ {brandLogo && (
+ <button
+ onClick={() => setBrandLogo(null)}
+ aria-label={i18n.t('settings.removeLogo')}
+ className="w-7 h-7 rounded-lg flex items-center justify-center text-muted-foreground hover:text-foreground hover:bg-secondary transition-colors"
+ >
+ <Trash2 size={14} />
+ </button>
+ )}
+ </div>
+ </div>
+
+ <div>
+ <label className="block text-[11px] font-semibold text-foreground mb-1">
+ {i18n.t('settings.footerLine')}
+ </label>
+ <Input
+ value={brandFooter}
+ onChange={(e) => setBrandFooter(e.target.value)}
+ placeholder={i18n.t('settings.footerLinePlaceholder')}
+ className="h-8 text-[12px] rounded-lg border-border"
+ />
+ <div className="flex flex-wrap gap-1.5 mt-2">
+ {FOOTER_PRESETS().map((preset) => (
+ <button
+ key={preset}
+ type="button"
+ onClick={() => setBrandFooter(preset)}
+ className={`px-2 py-1 rounded-md border text-[10px] transition-colors ${
+ brandFooter === preset
+ ? 'border-accent text-accent'
+ : 'border-border text-muted-foreground hover:border-accent hover:text-foreground'
+ }`}
+ >
+ {preset}
+ </button>
+ ))}
+ </div>
+ </div>
+
+ <div className="flex items-center justify-between gap-3 pt-1">
+ <div>
+ <div className="text-[11px] font-semibold text-foreground">{i18n.t('settings.attribution')}</div>
+ <div className="text-[10px] text-muted-foreground">{i18n.t('settings.attributionHint')}</div>
+ </div>
+ <button
+ onClick={() => setBrandAttribution((prev) => !prev)}
+ className={`w-9 h-5 rounded-full transition-colors relative shrink-0 ${
+ brandAttribution ? 'bg-accent' : 'bg-border'
+ }`}
+ >
+ <span
+ className={`absolute top-0.5 left-0.5 w-4 h-4 rounded-full bg-white shadow-sm transition-transform ${
+ brandAttribution ? 'translate-x-4' : 'translate-x-0'
+ }`}
+ />
+ </button>
+ </div>
+ </div>
+
<div className="border border-border rounded-[10px] p-3.5 space-y-1">
<div className="flex items-center gap-2.5 mb-2">
<div className="w-7 h-7 rounded-lg bg-secondary flex items-center justify-center">