Download src/components/LogoV2/FeedColumn.tsx from chenbhao/codev: direct link, hf CLI and curl.
- Browser
- Download file 892 Bytes
-
https://huggingface.co/chenbhao/codev/resolve/main/src/components/LogoV2/FeedColumn.tsx
- Command line
-
hf download hf://chenbhao/codev/src/components/LogoV2/FeedColumn.tsx
-
curl -L -o FeedColumn.tsx https://huggingface.co/chenbhao/codev/resolve/main/src/components/LogoV2/FeedColumn.tsx
892 Bytes
| import * as React from 'react' | |
| import { Box } from '../../ink.js' | |
| import { Divider } from '../design-system/Divider.js' | |
| import type { FeedConfig } from './Feed.js' | |
| import { calculateFeedWidth, Feed } from './Feed.js' | |
| type FeedColumnProps = { | |
| feeds: FeedConfig[] | |
| maxWidth: number | |
| } | |
| export function FeedColumn({ | |
| feeds, | |
| maxWidth, | |
| }: FeedColumnProps): React.ReactNode { | |
| const feedWidths = feeds.map(feed => calculateFeedWidth(feed)) | |
| const maxOfAllFeeds = Math.max(...feedWidths) | |
| const actualWidth = Math.min(maxOfAllFeeds, maxWidth) | |
| return ( | |
| <Box flexDirection="column"> | |
| {feeds.map((feed, index) => ( | |
| <React.Fragment key={index}> | |
| <Feed config={feed} actualWidth={actualWidth} /> | |
| {index < feeds.length - 1 && ( | |
| <Divider color="clawd_body" width={actualWidth} /> | |
| )} | |
| </React.Fragment> | |
| ))} | |
| </Box> | |
| ) | |
| } | |