diff --git a/apps/playground-app/src/features/brewery-of-the-day/view.tsx b/apps/playground-app/src/features/brewery-of-the-day/view.tsx index 583d4d6..12c0997 100644 --- a/apps/playground-app/src/features/brewery-of-the-day/view.tsx +++ b/apps/playground-app/src/features/brewery-of-the-day/view.tsx @@ -1,24 +1,20 @@ -"use client" +"use client"; -import { reflect, variant } from "@effector/reflect"; -import { BreweryCard, Loader } from "#root/shared/ui"; +import { reflect } from "@effector/reflect"; +import { BreweryCard } from "#root/shared/ui"; import { $breweryOfTheDay } from "./model"; -export const BreweryOfTheDay = variant({ - if: $breweryOfTheDay.map((brewery) => !!brewery), - then: reflect({ - view: BreweryCard, - bind: { - name: $breweryOfTheDay.map((brewery) => brewery?.name ?? "Unknown"), - brewery_type: $breweryOfTheDay.map( - (brewery) => brewery?.brewery_type ?? "nano" - ), - website_url: $breweryOfTheDay.map( - (brewery) => brewery?.website_url ?? null - ), - image: $breweryOfTheDay.map((brewery) => brewery?.image ?? ""), - }, - }), - else: Loader, +export const BreweryOfTheDay = reflect({ + view: BreweryCard, + bind: { + name: $breweryOfTheDay.map((brewery) => brewery?.name ?? "Unknown"), + brewery_type: $breweryOfTheDay.map( + (brewery) => brewery?.brewery_type ?? "nano" + ), + website_url: $breweryOfTheDay.map( + (brewery) => brewery?.website_url ?? null + ), + image: $breweryOfTheDay.map((brewery) => brewery?.image ?? ""), + }, });