import React, { useMemo } from 'react'
import { RiCheckLine, RiVerifiedBadgeLine } from '@remixicon/react'
import type { FC } from 'react'
import { LeftCorner } from '../base/icons/src/vender/plugin'
import type { Plugin } from './types'
import { getLocaleOnServer } from '@/i18n/server'
import cn from '@/utils/classnames'
export const CornerMark = ({ text }: { text: string }) => {
return (
)
}
export const Icon = ({
className,
src,
installed = false,
}: {
className?: string
src: string
installed?: boolean
}) => {
return (
)
}
export const Title = ({
title,
}: {
title: string
}) => {
return (
{title}
)
}
export const OrgInfo = ({
className,
orgName,
packageName,
}: {
className?: string
orgName: string
packageName: string
}) => {
return
{orgName}
/
{packageName}
}
type DescriptionProps = {
className?: string
text: string
descriptionLineRows: number
}
export const Description: FC = ({
className,
text,
descriptionLineRows,
}) => {
const lineClassName = useMemo(() => {
if (descriptionLineRows === 1)
return 'truncate'
else if (descriptionLineRows === 2)
return 'line-clamp-2'
else
return 'line-clamp-3'
}, [descriptionLineRows])
return (
{text}
)
}
type Props = {
className?: string
payload: Plugin
installed?: boolean
descriptionLineRows?: number
footer?: React.ReactNode
}
const Card = ({
className,
payload,
installed,
descriptionLineRows = 2,
footer,
}: Props) => {
const locale = getLocaleOnServer()
const { type, name, org, label } = payload
return (
{/* Header */}
{footer &&
{footer}
}
)
}
export default Card