({
projectName,
dashboardUrl = 'https://dashboard.openpanel.dev',
dateRange,
narrative,
stats,
insights,
unsubscribeUrl,
}: Props & { unsubscribeUrl?: string })
| 36 | } |
| 37 | |
| 38 | export function WeeklyDigest({ |
| 39 | projectName, |
| 40 | dashboardUrl = 'https://dashboard.openpanel.dev', |
| 41 | dateRange, |
| 42 | narrative, |
| 43 | stats, |
| 44 | insights, |
| 45 | unsubscribeUrl, |
| 46 | }: Props & { unsubscribeUrl?: string }) { |
| 47 | return ( |
| 48 | <Layout unsubscribeUrl={unsubscribeUrl}> |
| 49 | <Heading as="h2" className="text-xl font-semibold"> |
| 50 | Your week on {projectName} |
| 51 | </Heading> |
| 52 | <Text className="text-sm text-gray-500">{dateRange}</Text> |
| 53 | |
| 54 | {narrative && <Text>{narrative}</Text>} |
| 55 | |
| 56 | {stats.length > 0 && ( |
| 57 | <Section className="my-4"> |
| 58 | {stats.map((s) => ( |
| 59 | <Text key={s.label} className="my-1"> |
| 60 | <strong>{s.value}</strong> {s.label} |
| 61 | {s.delta && ( |
| 62 | <span style={{ color: deltaColor(s.direction) }}> |
| 63 | {' '} |
| 64 | ({s.delta}) |
| 65 | </span> |
| 66 | )} |
| 67 | </Text> |
| 68 | ))} |
| 69 | </Section> |
| 70 | )} |
| 71 | |
| 72 | {insights.length > 0 && ( |
| 73 | <> |
| 74 | <Hr /> |
| 75 | <Heading as="h3" className="text-base font-semibold"> |
| 76 | What stood out |
| 77 | </Heading> |
| 78 | <List |
| 79 | items={insights.map((i) => ( |
| 80 | <span key={i.title}> |
| 81 | <strong>{i.title}</strong> |
| 82 | {i.summary ? ` — ${i.summary}` : ''} |
| 83 | </span> |
| 84 | ))} |
| 85 | /> |
| 86 | </> |
| 87 | )} |
| 88 | |
| 89 | <Section className="mt-6"> |
| 90 | <Link href={withUtm(dashboardUrl, 'weekly-digest')}> |
| 91 | Open your dashboard → |
| 92 | </Link> |
| 93 | </Section> |
| 94 | </Layout> |
| 95 | ); |
nothing calls this directly
no test coverage detected