import {React} from "https://deno.land/x/lume@v2.2.1/deps/react.ts" import {ratingToClassName} from "../_utils/rating.ts" export type ReviewInfoProps = { name?: string, rating?: number, metadata?: React.ReactNode, children?: React.ReactNode, } export function ReviewInfo({name, rating, metadata, children}: ReviewInfoProps) { const reviewBarStyle = {} if(rating) { reviewBarStyle["width"] = `${rating}%` } const ratingClass = ratingToClassName(rating); return (

{name}

{rating}
{metadata}
{children}
) } export type ReviewInfoMetadataRowProps = { label?: React.ReactNode, icon?: React.ReactNode, className?: string, children?: React.ReactNode } ReviewInfo.MetadataRow = function ReviewInfoMetadataRow({label, icon, className, children}: ReviewInfoMetadataRowProps) { return <>
{label}
{icon &&
{icon}
}
{children}
}