videogen/apps/mobile/components/creators/CreatorProfileCard.tsx
caelum0x d56639a594
Some checks failed
build-images / web (push) Has been cancelled
vision2026-ci / Python SDK resource tests (push) Has been cancelled
build-images / api (push) Has been cancelled
build-images / worker-gpu (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (comfy-workflow-schema) (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (effects-core) (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (eventbus-types) (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (growth-analytics) (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (provider-adapter-kit) (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (publishing-connectors) (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (render-core) (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (shot-template-schema) (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (trends-schema) (push) Has been cancelled
vision2026-ci / Desktop engine crates (test + clippy + fmt) (push) Has been cancelled
codeql / Analyze (javascript-typescript) (push) Has been cancelled
codeql / Analyze (python) (push) Has been cancelled
perf / API hot-path micro-smoke (budgeted) (push) Has been cancelled
perf / Desktop engine crates (release build check) (push) Has been cancelled
vision2026-ci / API phase modules (ruff + pytest) (push) Has been cancelled
vision2026-ci / Alembic upgrade + drift check (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (caption-engine) (push) Has been cancelled
Menivor — open source release (MIT), free to use and fork
Paid, hosted product at menivor.com, now retired as a company project.
Fresh squashed history of the cleaned working tree (secret-scanned,
no .env, no customer data, no outreach logs). Built on
MoneyPrinterTurbo (MIT, harry0703) — see NOTICE.
2026-12-04 02:10:26 +03:00

87 lines
2.7 KiB
TypeScript

/**
* The public identity card for a creator profile screen: display name, "@handle",
* bio, and a grid of PUBLIC reputation aggregates. It renders ONLY safe public
* fields from {@link CreatorProfile} — never credits, email, cost/revenue or a
* `user_id`. The parent owns the follow control and passes it as `footer` so the
* card stays purely presentational.
*/
import type { ReactNode } from "react";
import { StyleSheet, Text, View } from "react-native";
import type { CreatorProfile } from "@/lib/types";
import { colors } from "@/components/me/theme";
import { CreatorStat } from "./CreatorStat";
import { creatorSubtitle, creatorTitle, formatCompact, formatRating } from "./format";
interface CreatorProfileCardProps {
profile: CreatorProfile;
/**
* Optimistic follower count after a follow/unfollow toggle; falls back to the
* profile's own `follower_count` when not supplied.
*/
followerCount?: number;
/** Optional action area (e.g. the follow button) rendered below the stats. */
footer?: ReactNode;
}
export function CreatorProfileCard({
profile,
followerCount,
footer,
}: CreatorProfileCardProps) {
const subtitle = creatorSubtitle(profile);
const followers =
typeof followerCount === "number" ? followerCount : profile.follower_count;
return (
<View style={styles.card}>
<Text style={styles.title}>{creatorTitle(profile)}</Text>
{subtitle ? <Text style={styles.subtitle}>{subtitle}</Text> : null}
{profile.bio ? <Text style={styles.bio}>{profile.bio}</Text> : null}
<View style={styles.stats}>
<CreatorStat label="Followers" value={formatCompact(followers)} />
<CreatorStat
label="Following"
value={formatCompact(profile.following_count)}
/>
<CreatorStat
label="Published"
value={formatCompact(profile.published_template_count)}
/>
<CreatorStat
label="Clones"
value={formatCompact(profile.total_clones_received)}
/>
<CreatorStat label="Rating" value={formatRating(profile.avg_rating)} />
</View>
{footer ? <View style={styles.footer}>{footer}</View> : null}
</View>
);
}
const styles = StyleSheet.create({
card: {
backgroundColor: colors.card,
borderColor: colors.border,
borderWidth: 1,
borderRadius: 12,
padding: 16,
gap: 10,
},
title: { color: colors.textPrimary, fontSize: 20, fontWeight: "800" },
subtitle: { color: colors.accent, fontSize: 14, fontWeight: "600" },
bio: { color: colors.textSecondary, fontSize: 14, lineHeight: 20 },
stats: {
flexDirection: "row",
flexWrap: "wrap",
gap: 8,
marginTop: 4,
},
footer: { marginTop: 6 },
});