"use client"; import { useState, useTransition } from "react"; import { entferneAppIcon, ladeAppIconHoch } from "@/app/firma/actions"; import { Alert } from "@/components/ui/Alert"; import { Button } from "@/components/ui/Button"; import { FIELD_CLASSES, FormField } from "@/components/ui/FormField"; export function AppIconForm({ hatAppIcon, vorschauUrl }: { hatAppIcon: boolean; vorschauUrl: string }) { const [fehler, setFehler] = useState(null); const [isPending, startTransition] = useTransition(); function handleSubmit(event: React.FormEvent) { event.preventDefault(); const form = event.currentTarget; const formData = new FormData(form); startTransition(async () => { const ergebnis = await ladeAppIconHoch(formData); setFehler(ergebnis.success ? null : ergebnis.error); if (ergebnis.success) form.reset(); }); } function handleEntfernen() { startTransition(async () => { const ergebnis = await entferneAppIcon(); setFehler(ergebnis.success ? null : ergebnis.error); }); } return (
{fehler && (
{fehler}
)} {/* eslint-disable-next-line @next/next/no-img-element -- oeffentliche App-Icon-Route, zeigt auch den Fallback */} Aktuelles App-Icon

Erscheint auf dem Startbildschirm. Ohne eigenes App-Icon wird es aus dem Logo erzeugt. Bereits installierte iPhone-Apps übernehmen ein neues Icon erst nach Neuinstallation.

{hatAppIcon && ( )}
); }