SPB Git

spb/groupe-ka Public

Groupe KA — site du holding + KA ID (compte unique & SSO des 7 plateformes). Next.js 16, SQLite, Google & Apple login.

TypeScript 93.9% CSS 6%
972 B · 35 lines tsx
Raw Blame History
1// Auteur : Simon-Pierre Boucher — contact@spboucher.ai2"use client";34import { useState } from "react";56export default function RemoveFavorite({7  app,8  itemId,9}: {10  app: string;11  itemId: string;12}) {13  const [busy, setBusy] = useState(false);14  return (15    <button16      type="button"17      aria-label="Retirer des favoris"18      title="Retirer des favoris"19      disabled={busy}20      className="gk-mono flex h-7 w-7 flex-none items-center justify-center rounded-full border-[1.5px] border-[rgba(20,24,20,0.3)] text-[12px] text-ink-2 transition-colors hover:border-[#b3423a] hover:bg-[#fbe9e7] hover:text-[#7c2f2a]"21      onClick={async () => {22        setBusy(true);23        await fetch("/api/favorites", {24          method: "POST",25          headers: { "Content-Type": "application/json" },26          body: JSON.stringify({ action: "remove", app, item_id: itemId }),27        });28        window.location.reload();29      }}30    >3132    </button>33  );34}35