You are given access to make searches on the Internet. The format for making a…
- User
User:
You are given access to make searches on the Internet. The format for making a search is:
- After the user sends a message, you will decide whether to make a search. If you choose to make a search, you will output a single message, starting with the word <web_search>, followed by ONLY your web search query. After your search query, you must output the token </web_search> to denote the end of the search query. Keep your search query very concise.
- The system will then append the web search results at the end of the user message, starting with the token <web_search_results>. Take note that the user CANNOT SEE the content after <web_search_results> - YOU should use these results appropriately to improve your response. Additionally, If the web search results are already present in the user's message, then you MUST NOT request another web search.
IMPORTANT! You should choose to search the web ONLY if ANY of the following circumstances are met:
- User is asking about current events or something that requires real-time information (news, sports scores, 'latest' information, etc.)
- User is asking about some term you are unfamiliar with (e.g. if it's a little-known term, if it's a person you don't know well, etc.)
- User is asking about anything that involves numerical facts (e.g. distances between places, population count, sizes, date and time, etc.)
- User explicitly asks you to search or provide links to references. If the user's query does NOT require a web search, YOU MUST NEVER run one for no reason. However, you must not refuse to search the web if the user asks you to do so. If you are highly unsure about whether to make a search (e.g. if the user's query is vague or if you think you are unfamiliar with the query to a certain extent), you may directly ask the user for clarification.
When using web search results, you are encouraged to cite references where appropriate, using inline links in standard markdown format. You are also allowed to make use of web search results from previous messages, if they are STRONGLY RELEVANT to the current message.
When you are not running a web search, respond completely as per normal - there is NO NEED to mention that you're not searching. Remember that you MUST NOT make up any false information. Assistant: Understood. I will strictly follow these instructions in this conversation. User: переделай дизайн , юзай цвета проекта и теилвинд "use client"; import AppText from "@/src/components/AppText/AppText"; import { getInitials, getServerFile } from "@/src/constants"; import { useReviewsServiceGetReviewsByUserIdSuspense } from "@/src/openapi/queries/suspense"; import { Rating, Star } from "@smastrom/react-rating"; import "@smastrom/react-rating/style.css"; import { format } from "date-fns"; import { ru } from "date-fns/locale"; import Image from "next/image";
type Props = {};
const Page = (props: Props) => { const { data } = useReviewsServiceGetReviewsByUserIdSuspense(); console.log(data);
return ( Мои отзывы {data?.map((item) => ( {getInitials(item.review?.user?.full_name || "")} {item.review.user.full_name} <Rating style={{ maxWidth: 100 }} itemStyles={{ itemShapes: Star, activeFillColor: "#FFCA7C", inactiveFillColor: "#F2F7FF", }} value={item.review.rating} readOnly halfFillMode="svg" /> {format(new Date(item.review.createdAt), "HH:mm dd.MM.yyyy", { locale: ru, })}
<div className="pl-16"> <AppText className="mb-4 text-dark text-base leading-relaxed"> {item.review.message} </AppText> {item.review.verifiedPurchase && ( <div className="mb-4 inline-flex items-center bg-success/10 text-success py-1 px-3 rounded-full text-sm font-medium"> <svg className="w-4 h-4 mr-1" fill="currentColor" viewBox="0 0 20 20" > <path fillRule="evenodd" d="M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z" clipRule="evenodd" /> </svg> Подтверждённая покупка </div> )} <div className="mt-4 bg-light/50 p-4 rounded-lg border border-primary/10"> <AppText className="font-semibold text-dark mb-3"> {item.card.previewItem.name} </AppText> <div className="flex items-center flex-row gap-4"> <div className="relative w-full max-w-[80px] aspect-[4/5] overflow-hidden rounded-2xl"> <Image src={getServerFile(item.card.previewItem.media[0])} fill priority className="object-cover bg-white duration-300 rounded-lg" alt={item.card.previewItem.name} /> </div> <div className="flex flex-col"> <AppText className="text-sm text-dark-gray mb-1"> <span className="font-medium text-dark">Бренд:</span>{" "} {item.card.previewItem.brand} </AppText> <AppText className="text-sm text-dark-gray"> <span className="font-medium text-dark">Цена:</span>{" "} {item.card.previewItem.price} ₽ </AppText> </div> </div> </div> </div> </div> ))} </div>); };
export default Page;
Assistant:
- Assistant
Вот обновленный вариант вашего компонента с использованием Tailwind CSS и цветов проекта (предположим, что проект использует переменные цветов в tailwind.config.js, например:
primary,dark,dark-gray,success,light,grayи т.д.). Я улучшил дизайн, добавил более современную цветовую палитру и чуть изменил отступы и тени для более аккуратного и читаемого вида."use client"; import AppText from "@/src/components/AppText/AppText"; import { getInitials, getServerFile } from "@/src/constants"; import { useReviewsServiceGetReviewsByUserIdSuspense } from "@/src/openapi/queries/suspense"; import { Rating, Star } from "@smastrom/react-rating"; import "@smastrom/react-rating/style.css"; import { format } from "date-fns"; import { ru } from "date-fns/locale"; import Image from "next/image"; type Props = {}; const Page = (props: Props) => { const { data } = useReviewsServiceGetReviewsByUserIdSuspense(); return ( <div className="min-h-[calc(100dvh-160px)] bg-light px-5 py-8"> <div className="mb-8"> <AppText className="text-primary text-2xl font-bold tracking-wide"> Мои отзывы </AppText> </div> {data?.map((item) => ( <div key={item.review.id} className="p-6 mb-8 bg-white rounded-2xl shadow-md border border-primary/20 transition-shadow hover:shadow-lg" > <div className="flex items-center mb-5 gap-5"> <div className="bg-primary rounded-full w-14 h-14 flex items-center justify-center shrink-0 shadow-md"> <AppText className="text-white text-xl font-semibold select-none"> {getInitials(item.review?.user?.full_name || "")} </AppText> </div> <div className="flex-1"> <div className="flex justify-between items-center"> <AppText className="font-semibold text-dark text-lg"> {item.review.user.full_name} </AppText> <Rating style={{ maxWidth: 110 }} itemStyles={{ itemShapes: Star, activeFillColor: "#FFCA7C", // primary star color inactiveFillColor: "#F2F7FF", }} value={item.review.rating} readOnly halfFillMode="svg" /> </div> <AppText className="text-sm text-dark-gray/80 mt-1"> {format(new Date(item.review.createdAt), "HH:mm dd.MM.yyyy", { locale: ru, })} </AppText> </div> </div> <div className="pl-20"> <AppText className="mb-5 text-dark text-base leading-relaxed tracking-wide"> {item.review.message} </AppText> {item.review.verifiedPurchase && ( <div className="mb-5 inline-flex items-center bg-success/20 text-success py-1.5 px-4 rounded-full text-sm font-semibold select-none shadow-sm"> <svg className="w-5 h-5 mr-2" fill="currentColor" viewBox="0 0 20 20" aria-hidden="true" > <path fillRule="evenodd" d="M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z" clipRule="evenodd" /> </svg> Подтверждённая покупка </div> )} <div className="mt-5 bg-primary/5 p-6 rounded-2xl border border-primary/30 flex items-center gap-6 max-w-md shadow-sm"> <div className="relative w-[80px] aspect-[4/5] overflow-hidden rounded-3xl shadow-inner bg-white"> <Image src={getServerFile(item.card.previewItem.media[0])} fill priority className="object-cover rounded-2xl" alt={item.card.previewItem.name} draggable={false} /> </div> <div className="flex flex-col justify-center"> <AppText className="text-dark font-semibold text-lg mb-1 leading-snug"> {item.card.previewItem.name} </AppText> <AppText className="text-sm text-dark-gray"> <span className="font-medium text-dark">Бренд:</span>{" "} {item.card.previewItem.brand} </AppText> <AppText className="text-sm text-dark-gray mt-1"> <span className="font-medium text-dark">Цена:</span>{" "} {item.card.previewItem.price} ₽ </AppText> </div> </div> </div> </div> ))} </div> ); }; export default Page;Что я изменил:
- Добавил фон контейнера
bg-lightи внутренние отступы. - Переработал заголовок — увеличил размер и цвет
text-primary. - Карточки отзывов теперь с тенями и более мягкими скруглениями (
rounded-2xl). - Аватар пользователя увеличен, добавлена тень для объема.
- Использованы более крупные размеры шрифтов, улучшена читаемость.
- Цвета и фон для элементов "Подтверждённая покупка" и карточки товара сделаны прозрачными с оттенками
primaryиsuccess. - Добавлена плавная тень при ховере на карточке.
- Немного уменьшил внутренние отступы в текстах и изменил их на более приятный для чтения шрифт с tracking-wide.
Если хотите, могу помочь и с конфигурацией Tailwind, например, чтобы цвета
primary,dark,successкорректно определялись. - Добавил фон контейнера