import React from 'react'; import { format } from 'date-fns'; import { Layers3, Crown, Zap } from 'lucide-react'; import type { TPrompt, TPromptGroup } from 'librechat-data-provider'; import { Tag, TooltipAnchor, Label } from '~/components/ui'; import { useLocalize } from '~/hooks'; import { cn } from '~/utils'; const CombinedStatusIcon = ({ description }: { description: string }) => ( } > ); const VersionTags = ({ tags }: { tags: string[] }) => { const localize = useLocalize(); const isLatestAndProduction = tags.includes('latest') && tags.includes('production'); if (isLatestAndProduction) { return ( ); } return ( {tags.map((tag, i) => ( { if (tag === 'production') { return (
); } if (tag === 'latest') { return (
); } return null; })()} /> } >
))}
); }; const VersionCard = ({ prompt, index, isSelected, totalVersions, onClick, authorName, tags, }: { prompt: TPrompt; index: number; isSelected: boolean; totalVersions: number; onClick: () => void; authorName?: string; tags: string[]; }) => { const localize = useLocalize(); return ( ); }; const PromptVersions = ({ prompts, group, selectionIndex, setSelectionIndex, }: { prompts: TPrompt[]; group?: TPromptGroup; selectionIndex: number; setSelectionIndex: React.Dispatch>; }) => { const localize = useLocalize(); return (

{localize('com_ui_versions')}

{prompts.map((prompt: TPrompt, index: number) => { const tags: string[] = []; if (index === 0) { tags.push('latest'); } if (prompt._id === group?.productionId) { tags.push('production'); } return ( setSelectionIndex(index)} authorName={group?.authorName} tags={tags} /> ); })}
); }; export default PromptVersions;