diff --git a/src/app/dashboard/writer/page.tsx b/src/app/dashboard/writer/page.tsx index 52a5134f..dd624c40 100644 --- a/src/app/dashboard/writer/page.tsx +++ b/src/app/dashboard/writer/page.tsx @@ -139,14 +139,14 @@ function StorylineDetail({ storyline, writerAddress }: { storyline: Storyline; w )} {storyline.token_address && ( - <> +
diff --git a/src/components/WriterTradingStats.tsx b/src/components/WriterTradingStats.tsx index 9d50fc8e..b87ba34e 100644 --- a/src/components/WriterTradingStats.tsx +++ b/src/components/WriterTradingStats.tsx @@ -6,14 +6,6 @@ import { publicClient } from "../../lib/rpc"; import { mcv2BondAbi, getTokenTVL } from "../../lib/price"; import { MCV2_BOND, IS_TESTNET } from "../../lib/contracts/constants"; import type { Storyline } from "../../lib/supabase"; -import { supabase } from "../../lib/supabase"; - -function formatTruncated(value: bigint, decimals: number, digits = 6): string { - const raw = formatUnits(value, decimals); - const dot = raw.indexOf("."); - if (dot === -1 || raw.length - dot - 1 <= digits) return raw; - return raw.slice(0, dot + 1 + digits).replace(/0+$/, "").replace(/\.$/, ""); -} interface WriterTradingStatsProps { storyline: Storyline; @@ -45,34 +37,10 @@ export function WriterTradingStats({ storyline }: WriterTradingStatsProps) { enabled: !!tokenAddress, }); - // Fetch total donations for this storyline - const { data: donationsTotal } = useQuery({ - queryKey: ["writer-donations", storyline.storyline_id], - queryFn: async () => { - if (!supabase) return BigInt(0); - // eslint-disable-next-line @typescript-eslint/no-explicit-any - const { data } = await (supabase.from("donations") as any) - .select("amount") - .eq("storyline_id", storyline.storyline_id); - if (!data) return BigInt(0); - return (data as { amount: string }[]).reduce((sum, d) => sum + BigInt(d.amount), BigInt(0)); - }, - }); - const decimals = tvlData?.decimals; return ( -