import { useState } from 'react'; import { z } from 'zod'; import { getRandomGrey } from '../../../../utils/getRandomGrey'; import { NewsTileSchema } from '../../../../utils/schemas'; type CardContentProps = { story: z.infer; side: boolean; }; export function TileContent({ story, side }: CardContentProps) { const [firstColor, setFirstColor] = useState(getRandomGrey()); const [secondColor, setSecondColor] = useState(getRandomGrey()); const [switched, setSwitched] = useState(true); if (switched !== side) { setFirstColor(getRandomGrey()); setSecondColor(getRandomGrey()); setSwitched(side); } const color = side ? firstColor : secondColor; return (

{story.title}

by {story.by}

); }