MCPcopy Create free account
hub / github.com/dailydotdev/apps / PlusOptionRadio

Function PlusOptionRadio

packages/shared/src/components/plus/PlusOptionRadio.tsx:23–105  ·  view source on GitHub ↗
({
  option,
  checked,
  onChange,
  shouldShowMonthlyPrice,
  shouldShowDuration,
  isOrganization,
}: PlusOptionRadioProps)

Source from the content-addressed store, hash-verified

21}
22
23export function PlusOptionRadio({
24 option,
25 checked,
26 onChange,
27 shouldShowMonthlyPrice,
28 shouldShowDuration,
29 isOrganization,
30}: PlusOptionRadioProps): ReactElement {
31 if (!option) {
32 return null;
33 }
34
35 const { metadata, priceId, price } = option;
36 const finalPrice = shouldShowMonthlyPrice
37 ? price.monthly?.formatted || price.formatted
38 : price.formatted;
39
40 return (
41 <RadioItem
42 key={priceId}
43 name={metadata.title}
44 id={`${metadata.title}-${priceId}`}
45 value={priceId}
46 checked={checked}
47 onChange={() => onChange(priceId)}
48 className={{
49 content: classNames(
50 'min-h-12 rounded-10 !p-2',
51 checked
52 ? '-m-px border border-border-subtlest-primary bg-surface-float'
53 : undefined,
54 ),
55 }}
56 >
57 <div className="flex flex-1 flex-wrap items-center gap-x-3 gap-y-1">
58 <Typography
59 tag={TypographyTag.Span}
60 type={TypographyType.Callout}
61 color={TypographyColor.Primary}
62 >
63 {metadata.title}
64 </Typography>
65
66 {metadata.caption && (
67 <PlusPlanExtraLabel
68 color={metadata.caption.color}
69 label={metadata.caption.copy}
70 />
71 )}
72 </div>
73 <div className="ml-auto mr-1 flex items-center gap-1">
74 <Typography
75 tag={TypographyTag.Span}
76 type={TypographyType.Body}
77 color={TypographyColor.Primary}
78 bold
79 >
80 {finalPrice}

Callers

nothing calls this directly

Calls 1

onChangeFunction · 0.50

Tested by

no test coverage detected