feat: add text pair component
This commit is contained in:
parent
6c9b80cd65
commit
852c25484b
19
app/components/ui/text-pair.tsx
Normal file
19
app/components/ui/text-pair.tsx
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
import { Text } from '~/components/ui/text';
|
||||||
|
import { cn } from '~/lib/utils';
|
||||||
|
|
||||||
|
interface TextPairProps {
|
||||||
|
title: string;
|
||||||
|
meta: string;
|
||||||
|
as?: 'p' | 'h3';
|
||||||
|
className?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
// A truncating title with a muted caption underneath
|
||||||
|
export function TextPair({ title, meta, as = 'p', className }: TextPairProps) {
|
||||||
|
return (
|
||||||
|
<div className={cn('min-w-0', className)}>
|
||||||
|
<Text as={as} variant='body-strong' truncate>{title}</Text>
|
||||||
|
<Text variant='meta' truncate>{meta}</Text>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user