diff --git a/public/img/pages/home/streaming/aivazovsky.png b/public/img/pages/home/streaming/aivazovsky.png new file mode 100644 index 00000000..eacc231d Binary files /dev/null and b/public/img/pages/home/streaming/aivazovsky.png differ diff --git a/public/img/pages/home/streaming/revolution.png b/public/img/pages/home/streaming/revolution.png new file mode 100644 index 00000000..19af249a Binary files /dev/null and b/public/img/pages/home/streaming/revolution.png differ diff --git a/src/components/pages/MainPage/Streaming.tsx b/src/components/pages/MainPage/Streaming.tsx index f5b9895c..4126508c 100644 --- a/src/components/pages/MainPage/Streaming.tsx +++ b/src/components/pages/MainPage/Streaming.tsx @@ -1,31 +1,10 @@ -'use client'; - -import { api } from '@/api'; import { ArrowMoreIcon } from '@/components/icons/ArrowMoreIcon'; import { IProject } from '@/types/IProject'; import { Descriptor } from '@/ui/Descriptor'; import { Title } from '@/ui/Title'; import Image from 'next/image'; -import { useEffect, useState } from 'react'; export function Streaming() { - const [streamingProjects, setSteramingProjects] = useState([]); - - useEffect(() => { - getStreamingProjects(); - }, []); - - async function getStreamingProjects() { - try { - const projects: IProject[] = await api.get('projects').json(); - setSteramingProjects( - projects.filter(project => project.devices.includes('stream')), - ); - } catch (error) { - alert(`Error: ${error}`); - } - } - return (
@@ -61,20 +40,31 @@ export function Streaming() { </p> </div> <div className="p-4 grid grid-cols-3 gap-4 col-start-4 col-span-full border-y border-[#3D425C]"> - {streamingProjects.map(streamingProject => ( - <StreamingProject {...streamingProject} key={streamingProject.id} /> - ))} + <StreamingProject + city="Екатеринбург" + name="Re:volution Towers" + image="/img/pages/home/streaming/revolution.png" + /> + <StreamingProject + city="Тюмень" + image="/img/pages/home/streaming/aivazovsky.png" + name="Айвазовский City" + /> </div> </div> </div> ); } -function StreamingProject({ city, name, image }: IProject) { +function StreamingProject({ + city, + name, + image, +}: Pick<IProject, 'city' | 'name' | 'image'>) { return ( <div className="flex flex-col justify-between gap-y-12 p-6 [background:center/cover_url(/img/pages/home/stats/highlight.svg)_no-repeat,#14161F] col-span-1"> <Image - src={process.env.NEXT_PUBLIC_API + '/upload/' + image} + src={image} width={164} height={164} alt={''}