+
setPopupOpen((prev) => !prev)} className={c(styles.select)}>
+
+ {model ? model.title : 'Загрузка...'}
+
+
+
+
+ {bots.map((item) => (
+ {
+ setPopupOpen(false)
+ push(`/images/${slug}`)
+ }}
+ {...item}
+ key={item.uid}
+ />
+ ))}
+
+
+ >
+ )
+}
@@ -0,0 +1,51 @@
+.model {
+ // font-family: Inter;
+ padding: 15px 20px;
+ cursor: pointer;
+ display: flex;
+ align-items: center;
+ gap: 22px;
+ justify-content: space-between;
+ max-width: 500px;
+
+ @media (max-width: 768px) {
+ // max-width: calc(100% - 100px) !important;
+ width: 100%;
+ // max-width: unset;
+ }
+ &__title {
+ font-weight: 600;
+ font-size: 18px;
+ margin-bottom: 4px;
+ }
+
+ &__description {
+ font-size: 14px;
+ color: #a4aab5;
+ margin-bottom: 7px;
+ }
+
+ &__badges {
+ display: flex;
+ gap: 10px;
+ }
+
+ &__badge {
+ padding: 4px 6px;
+ font-size: 13px;
+ display: flex;
+ align-items: center;
+ gap: 2px;
+ background-color: rgba($color: #a4aab5, $alpha: 0.1);
+ color: white;
+ font-weight: 500;
+ border-radius: 5px;
+ }
+
+ &__time {
+ gap: 6px;
+ color: var(--new-ui-gray-color);
+ }
+ &__cost {
+ }
+}
@@ -0,0 +1,82 @@
+import { IShortModel } from '@/src/entities/model-entity'
+import React, { useMemo } from 'react'
+
+import styles from './image-popup-model.module.scss'
+import { c, formatDate } from '@/src/shared/lib/helpers'
+import SuccessRoundedSvg from '@/src/assets/svg/success-rounded.svg?react'
+import ClockSvg from '@/src/assets/svg/clock.svg?react'
+import LightningSvg from '@/src/assets/svg/lightning.svg?react'
+import { CostZones } from '../types'
+
+interface ImagePopupModelProps extends IShortModel {
+ active: boolean
+ setActive: (slug: string) => void
+ averageTokenCost: number
+}
+
+export interface CostZone {
+ remainder: number
+ color: string
+}
+
+export const costZoneColors: CostZone[] = [
+ { remainder: -20, color: '#1EB034' },
+ { remainder: 20, color: '#B0891E' },
+ { remainder: 1000, color: '#B01E1E' },
+]
+
+export const ImagePopupModel = ({
+ uid,
+ title,
+ description,
+ slug,
+ image,
+ actual_stat,
+ active,
+ averageTokenCost,
+ setActive,
+}: ImagePopupModelProps) => {
+ // жесткий костыль))) - временный
+ const formatedTime = useMemo(() => {
+ if (!actual_stat) return null
+
+ const seconds = Number(actual_stat.generation_time.split(':')[2])
+
+ const range = Math.ceil(seconds - seconds / 3)
+
+ return `${range} - ${seconds} сек.`
+ }, [actual_stat])
+
+ const costZone = useMemo(() => {
+ if (!actual_stat) return null
+
+ const remainder = Number(actual_stat.tokens_cost) - averageTokenCost
+
+ return costZoneColors.find((item) => item.remainder > remainder)
+ }, [actual_stat, averageTokenCost])
+
+ return (
+