diff --git a/src/components/lineage/LineageCard.tsx b/src/components/lineage/LineageCard.tsx index bd126a75..3ea4db58 100644 --- a/src/components/lineage/LineageCard.tsx +++ b/src/components/lineage/LineageCard.tsx @@ -1,4 +1,5 @@ import { useEffect, useState } from "react"; +import { GitFork, GitBranch, Percent } from "lucide-react"; import { supabase } from "@/integrations/supabase/client"; interface ParentInfo { @@ -13,7 +14,8 @@ interface ChildSummary { } /** - * Renders lineage attribution for a package: + * Renders lineage attribution for a package — visible proof of the + * revenue-share moat: * - if this package was forked, link back to upstream and disclose rev-share * - if other packages forked this one, surface descendant count */ @@ -27,7 +29,9 @@ export function LineageCard({ packageId }: { packageId: string }) { const [pq, cq] = await Promise.all([ supabase .from("package_lineage") - .select("fork_kind, rev_share_bps, parent_package_id, packages!package_lineage_parent_package_id_fkey(slug,name)") + .select( + "fork_kind, rev_share_bps, parent_package_id, packages!package_lineage_parent_package_id_fkey(slug,name)", + ) .eq("child_package_id", packageId) .maybeSingle(), supabase @@ -37,7 +41,11 @@ export function LineageCard({ packageId }: { packageId: string }) { ]); if (cancel) return; const parentRow = pq.data as - | { fork_kind: string; rev_share_bps: number; packages: { slug: string; name: string } | null } + | { + fork_kind: string; + rev_share_bps: number; + packages: { slug: string; name: string } | null; + } | null; if (parentRow?.packages) { setParent({ @@ -49,30 +57,56 @@ export function LineageCard({ packageId }: { packageId: string }) { } setChildren({ count: cq.count ?? 0 }); })(); - return () => { cancel = true; }; + return () => { + cancel = true; + }; }, [packageId]); if (!parent && (!children || children.count === 0)) return null; return ( -