plano/apps/www/src/components/FeaturedBlogCard.tsx

118 lines
4 KiB
TypeScript
Raw Normal View History

feat: redesign archgw -> plano + website in Next.js (#613) * feat: redesign archgw -> plano + website * feat(www): refactor landing page sections, add new diagrams and UI improvements * feat(www): sections enhanced for clarify & diagrams added * feat(www): improvements to mobile design, layout of diagrams * feat(www): clean + typecheck * feat(www): feedback loop changes * feat(www): fix type error * fix lib/utils error * feat(www): ran biome formatting * feat(www): graphic changes * feat(www): web analytics * fea(www): changes * feat(www): introduce monorepo This change brings Turborepo monorepo to independently handle the marketing website, the docs website and any other future use cases for mutli-platform support. They are using internal @katanemo package handlers for the design system and logic. * fix(www): transpiler failure * fix(www): tsconfig issue * fix(www): next.config issue * feat(docs): hold off on docs * Delete next.config.ts * feat(www): content fix * feat(www): introduce blog * feat(www): content changes * Update package-lock.json * feat: update text * Update IntroSection.tsx * feat: Turbopack issue * fix * Update IntroSection.tsx * feat: updated Research page * refactor(www): text clarity, padding adj. * format(www) * fix: add missing lib/ files to git - fixes Vercel GitHub deployment - Updated .gitignore to properly exclude Python lib/ but include Next.js lib/ directories - Added packages/ui/src/lib/utils.ts (cn utility function) - Added apps/www/src/lib/sanity.ts (Sanity client configuration) - Fixes module resolution errors in Vercel GitHub deployments (case-sensitive filesystem) * Update .gitignore * style(www): favicon + metadata * fix(www): links * fix(www): add analytics * fix(www): add * fix(www): fix links + image * fix(www): fix links + image * fix(www): fix links * fix(www): remove from tools testing.md
2025-12-18 15:55:15 -08:00
"use client";
import { motion } from "framer-motion";
import Image from "next/image";
import Link from "next/link";
import { urlFor } from "@/lib/sanity";
interface FeaturedBlogCardProps {
post: {
_id: string;
title: string;
slug: { current: string };
summary?: string;
formattedDate?: string;
mainImage?: any;
mainImageUrl?: string;
author?: {
name?: string;
title?: string;
image?: any;
};
};
}
export function FeaturedBlogCard({ post }: FeaturedBlogCardProps) {
return (
<motion.div
initial={{ opacity: 0, y: 10 }}
animate={{ opacity: 1, y: 0 }}
transition={{
duration: 0.4,
ease: "easeOut",
}}
>
<Link href={`/blog/${post.slug.current}`} className="group block">
<motion.div
className="bg-linear-to-b from-primary/20 to-primary/1 border border-primary/20 rounded-md p-8 sm:p-10 lg:p-12"
whileHover={{
borderColor: "rgba(119, 128, 217, 0.5)",
}}
transition={{
duration: 0.2,
ease: "easeOut",
}}
>
<div className="grid lg:grid-cols-2 gap-8 lg:gap-12 items-center">
{/* Content */}
<div className="order-1 text-left">
{post.formattedDate && (
<div className="text-base font-medium tracking-[-0.9px] text-black mb-4">
{post.formattedDate}
</div>
)}
<h2 className="text-3xl sm:text-4xl lg:text-4xl font-medium tracking-[-1.5px] text-black mb-4 group-hover:text-[var(--secondary)] transition-colors text-left">
<span className="font-sans">{post.title}</span>
</h2>
{post.summary && (
<p className="text-base sm:text-base font-mono font-normal tracking-[-0.9px] text-black/70 mb-6 text-left">
{post.summary}
</p>
)}
{post.author && (
<div className="flex items-center gap-3">
{post.author.image ? (
<div className="relative w-12 h-12 rounded overflow-hidden shrink-0">
<Image
src={urlFor(post.author.image).width(80).url()}
alt={post.author.name || "Author"}
fill
className="object-cover"
/>
</div>
) : (
<div className="w-12 h-12 rounded-full bg-[var(--secondary)]/20 shrink-0" />
)}
<div>
{post.author.name && (
<div className="text-lg font-mono font-semibold tracking-wider text-primary uppercase">
{post.author.name}
</div>
)}
{post.author.title && (
<div className="text-sm font-mono font-normal tracking-wider text-[#28327D] uppercase">
{post.author.title}
</div>
)}
</div>
</div>
)}
</div>
{/* Image */}
<div className="relative aspect-[18/9] w-full overflow-hidden rounded-lg bg-black/5 order-2">
{post.mainImage ? (
<Image
src={urlFor(post.mainImage).width(800).url()}
alt={post.title}
fill
className="object-cover"
/>
) : post.mainImageUrl ? (
<Image
src={post.mainImageUrl}
alt={post.title}
fill
className="object-cover"
/>
) : (
<div className="w-full h-full bg-gradient-to-br from-[var(--secondary)]/20 to-black/10" />
)}
</div>
</div>
</motion.div>
</Link>
</motion.div>
);
}