Timeline - Link to subs

This commit is contained in:
John Groszko 2026-04-23 16:36:38 -05:00
parent cfccd424cb
commit 2089ee4161

View file

@ -14,6 +14,7 @@ import {
IconLock, IconLock,
IconX, IconX,
} from "@tabler/icons-react"; } from "@tabler/icons-react";
import { useUserContext } from "./UserContext";
const TIMELINE_TYPE = { const TIMELINE_TYPE = {
ORDER_NOT_ISSUED: { ORDER_NOT_ISSUED: {
@ -60,7 +61,10 @@ const TIMELINE_TYPE = {
export const TimelineList: React.FC<{ export const TimelineList: React.FC<{
timeline: TimelineEvent[]; timeline: TimelineEvent[];
}> = ({ timeline }) => ( }> = ({ timeline }) => {
const { username: my_username } = useUserContext();
return (
<Box> <Box>
<Title order={1} mb="lg"> <Title order={1} mb="lg">
Timeline Timeline
@ -115,7 +119,15 @@ export const TimelineList: React.FC<{
</Text> </Text>
) : null} ) : null}
<Text size="xs"> <Text size="xs">
{username != my_username ? (
<Anchor component={Link} to={`/orders/${username}`}>
<IconLock size="0.75rem" /> {username} <IconLock size="0.75rem" /> {username}
</Anchor>
) : (
<>
<IconLock size="0.75rem" /> {username}
</>
)}
</Text> </Text>
<Text size="xs">{moment(updated_at).fromNow()}</Text> <Text size="xs">{moment(updated_at).fromNow()}</Text>
</Flex> </Flex>
@ -126,3 +138,4 @@ export const TimelineList: React.FC<{
</Card> </Card>
</Box> </Box>
); );
};