Files
spoon/apps/expo/src/components/spoons/spoon-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

49 lines
1.4 KiB
TypeScript

import { Text, View } from 'react-native';
import type { Doc } from '@spoon/backend/convex/_generated/dataModel.js';
import { ListRow } from '~/components/ui/list-row';
import { formatDate } from '~/utils/format';
import { SpoonStatusBadge } from './spoon-status-badge';
export const SpoonListRow = ({
spoon,
openThreads,
onPress,
}: {
spoon: Doc<'spoons'>;
openThreads?: number;
onPress: () => void;
}) => (
<ListRow
meta={formatDate(spoon.lastCheckedAt)}
subtitle={`${spoon.upstreamOwner}/${spoon.upstreamRepo}`}
title={spoon.name}
onPress={onPress}
>
<View className='gap-3'>
<View className='flex-row flex-wrap items-center gap-2'>
<SpoonStatusBadge status={spoon.syncStatus ?? spoon.status} />
{spoon.forkOwner && spoon.forkRepo ? (
<Text className='text-muted-foreground text-xs'>
fork {spoon.forkOwner}/{spoon.forkRepo}
</Text>
) : (
<Text className='text-muted-foreground text-xs'>missing fork</Text>
)}
</View>
<View className='flex-row gap-4'>
<Text className='text-muted-foreground text-xs'>
{spoon.upstreamAheadBy ?? 0} upstream
</Text>
<Text className='text-muted-foreground text-xs'>
{spoon.forkAheadBy ?? 0} fork-only
</Text>
<Text className='text-muted-foreground text-xs'>
{openThreads ?? 0} threads
</Text>
</View>
</View>
</ListRow>
);