Files
spoon/apps/expo/src/components/threads/thread-list-row.tsx
T
Gabriel Brown 42f95530de
Build and Push Next App / quality (push) Successful in 1m27s
Build and Push Next App / build-next (push) Successful in 3m58s
Update expo application
2026-06-22 12:13:02 -04:00

37 lines
1.1 KiB
TypeScript

import { Text, View } from 'react-native';
import type { Doc } from '@spoon/backend/convex/_generated/dataModel.js';
import { Badge } from '~/components/ui/badge';
import { ListRow } from '~/components/ui/list-row';
import { formatDateTime, titleize, truncate } from '~/utils/format';
import { ThreadStatusBadge } from './thread-status-badge';
export const ThreadListRow = ({
thread,
onPress,
}: {
thread: Doc<'threads'>;
onPress: () => void;
}) => (
<ListRow
meta={formatDateTime(thread.updatedAt)}
subtitle={thread.summary ? truncate(thread.summary, 90) : undefined}
title={thread.title}
onPress={onPress}
>
<View className='flex-row flex-wrap gap-2'>
<ThreadStatusBadge status={thread.status} />
<Badge label={titleize(thread.source)} />
{thread.maintenanceOutcome ? (
<Badge label={titleize(thread.maintenanceOutcome)} tone='primary' />
) : null}
</View>
{thread.upstreamTo ? (
<Text className='text-muted-foreground mt-3 text-xs'>
upstream {thread.upstreamTo.slice(0, 12)}
</Text>
) : null}
</ListRow>
);