diff --git a/src/components/card-split/index.tsx b/src/components/card-split/index.tsx new file mode 100644 index 0000000..a5c3831 --- /dev/null +++ b/src/components/card-split/index.tsx @@ -0,0 +1,31 @@ +import { Glass } from "@/components/glass" +import { cn } from "@/lib/utils" +import { CardSplitPrimaryContent } from "./primary-content" +import { CardSplitSecondaryContent } from "./secondary-content" +import type { CardSplitProps } from "./types" + +export function CardSplit({ textPrimary, textSecondary, textSecondarySmall, className }: CardSplitProps) { + const hasPrimaryContent = Boolean(textPrimary) + const hasSecondaryContent = Boolean(textSecondary || textSecondarySmall) + + return ( + +
+ {textPrimary ? : null} + + {hasSecondaryContent && ( + + )} +
+
+ ) +} diff --git a/src/components/card-split/primary-content.tsx b/src/components/card-split/primary-content.tsx new file mode 100644 index 0000000..22079f6 --- /dev/null +++ b/src/components/card-split/primary-content.tsx @@ -0,0 +1,7 @@ +export function CardSplitPrimaryContent({ text }: { text: string }) { + return ( +

+ {text} +

+ ) +} diff --git a/src/components/card-split/secondary-content.tsx b/src/components/card-split/secondary-content.tsx new file mode 100644 index 0000000..f1b44a4 --- /dev/null +++ b/src/components/card-split/secondary-content.tsx @@ -0,0 +1,20 @@ +import { cn } from "@/lib/utils" + +type CardSplitSecondaryContentProps = { + textSecondary?: string + textSecondarySmall?: string + hasPrimaryContent: boolean +} + +export function CardSplitSecondaryContent({ + textSecondary, + textSecondarySmall, + hasPrimaryContent, +}: CardSplitSecondaryContentProps) { + return ( +
+ {textSecondary &&

{textSecondary}

} + {textSecondarySmall &&

{textSecondarySmall}

} +
+ ) +} diff --git a/src/components/card-split/types.ts b/src/components/card-split/types.ts new file mode 100644 index 0000000..1ad4557 --- /dev/null +++ b/src/components/card-split/types.ts @@ -0,0 +1,6 @@ +export type CardSplitProps = { + textPrimary?: string + textSecondary?: string + textSecondarySmall?: string + className?: string +}