Remove unused vars

This commit is contained in:
Ategon 2025-01-14 17:45:10 -05:00
parent d5e07cab45
commit 6289989bce
5 changed files with 35 additions and 53 deletions

View file

@ -1,8 +1,3 @@
import Posts from "../components/posts";
import Timers from "../components/timers";
import Streams from "../components/streams";
import Announcements from "../components/announcements";
import { Image } from "@nextui-org/image";
import { Button } from "@nextui-org/button";
import { SiDiscord } from "@icons-pack/react-simple-icons";

View file

@ -1,4 +1,3 @@
import Image from "next/image";
import User from "../../../components/user";
export default function UserPage() {

View file

@ -1,28 +1,12 @@
import {
Navbar as NavbarBase,
NavbarBrand,
NavbarContent,
NavbarItem,
} from "@nextui-org/navbar";
import { Link } from "@nextui-org/link";
import { Button } from "@nextui-org/button";
import { Divider } from "@nextui-org/divider";
import {
Dropdown,
DropdownItem,
DropdownMenu,
DropdownTrigger,
Image,
Tooltip,
} from "@nextui-org/react";
import {
SiBluesky,
SiDiscord,
SiForgejo,
SiLemmy,
SiTwitch,
} from "@icons-pack/react-simple-icons";
import { LogInIcon } from "lucide-react";
import { Tooltip } from "@nextui-org/react";
import { SiDiscord, SiForgejo } from "@icons-pack/react-simple-icons";
export default function Navbar() {
return (

View file

@ -1,33 +1,40 @@
import { Button, Card, CardBody, Chip, User } from "@nextui-org/react";
import { Heart } from "lucide-react";
import { format, formatDistance, formatRelative } from "date-fns";
import { formatDistance } from "date-fns";
import Link from "next/link";
export default function PostCard({post}) {
return (
<Card>
<CardBody>
<p className="text-xl">{post.title}</p>
export default function PostCard({ post }) {
return (
<Card>
<CardBody>
<p className="text-xl">{post.title}</p>
{post.flairs && Object.values(post.flairs).map((flair) => <div key={flair.id}>
<Chip>{flair.name}</Chip>
</div>)}
{post.flairs &&
Object.values(post.flairs).map((flair) => (
<div key={flair.id}>
<Chip>{flair.name}</Chip>
</div>
))}
<div className="flex items-center gap-3">
<p>By</p>
<Link href={`/u/${post.author.slug}`}>
<User
name={post.author.name}
/>
</Link>
<p>{formatDistance(new Date(post.createdAt), new Date(), { addSuffix: true })}</p>
</div>
<div className="flex items-center gap-3">
<p>By</p>
<Link href={`/u/${post.author.slug}`}>
<User name={post.author.name} />
</Link>
<p>
{formatDistance(new Date(post.createdAt), new Date(), {
addSuffix: true,
})}
</p>
</div>
<p>{post.content}</p>
<div className="flex justify-between">
<Button><Heart /> {post.likers.length}</Button>
</div>
</CardBody>
</Card>
)
}
<p>{post.content}</p>
<div className="flex justify-between">
<Button>
<Heart /> {post.likers.length}
</Button>
</div>
</CardBody>
</Card>
);
}

View file

@ -1,9 +1,6 @@
"use client";
import { Button, Card, CardBody, Chip, User } from "@nextui-org/react";
import { useEffect, useState } from "react";
import { Heart } from "lucide-react";
import Link from "next/link";
import PostCard from "./PostCard";
export default function Posts() {