import { Box, VStack, HStack, SpanBox } from '../../elements/LayoutPrimitives'
import { StyledText } from '../../elements/StyledText'
import { removeHTMLTags } from '../ArticleSubtitle'
import { MoreOptionsIcon } from '../../elements/images/MoreOptionsIcon'
import { theme } from '../../tokens/stitches.config'
import { CardMenu } from '../CardMenu'
import { LabelChip } from '../../elements/LabelChip'
import { ProgressBar } from '../../elements/ProgressBar'
import type { LinkedItemCardProps } from './CardTypes'
import { ProgressBarVertical } from '../../elements/ProgressBarVertical'
//Styles
const ellipsisText = {
overflow: 'hidden',
display: '-webkit-box',
WebkitLineClamp: 1,
WebkitBoxOrient: 'vertical',
margin: 'auto 0',
pr:'10px',
}
const cardTitleStyle = {
...ellipsisText,
width:'100%',
fontSize: '14px',
fontWeight: '600',
textAlign: 'left',
}
// Props
type CardTitleProps = {
title: string
}
// Functions
function CardTitle(
props: CardTitleProps,
): JSX.Element {
return (
{props.title}
)
}
// Component
export function LibraryGridCard(props: LinkedItemCardProps): JSX.Element {
return (
<>
{props.layout === 'GRID_LAYOUT' ? (
{
props.handleAction('showDetail')
}}
>
{
// This is here to prevent menu click events from bubbling
// up and causing us to "click" on the link item.
e.stopPropagation()
}}
>
}
actionHandler={props.handleAction}
/>
{props.item.author && (
{removeHTMLTags(props.item.author)}
)}
{props.originText && (
<>
{props.originText}
>
)}
{props.item.description}
{props.item.labels?.map(({ name, color }, index) => (
))}
) : (
// ELSE display List Layout
{props.item.labels?.map(({ name, color }, index) => (
))}
{props.item.description}
{props.item.author && (
{removeHTMLTags(props.item.author)}
)}
)}
>
)
}