Format next.js web app with prettier

This commit is contained in:
Debanjum Singh Solanky
2024-08-05 02:27:31 +05:30
parent 41bdd6d6d9
commit 842036688d
64 changed files with 5806 additions and 5087 deletions

View File

@@ -1,34 +1,25 @@
'use client'
import {
Card,
CardContent,
CardDescription,
CardHeader,
CardTitle,
} from "@/components/ui/card"
"use client";
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card";
import styles from "./suggestions.module.css";
import { getIconFromIconName } from "@/app/common/iconUtils";
import { converColorToBgGradient } from "@/app/common/colorUtils";
function convertSuggestionTitleToIconClass(title: string, color: string) {
if (title.includes('automation')) return getIconFromIconName('Robot', color, 'w-8', 'h-8');
if (title.includes('online')) return getIconFromIconName('Globe', color, 'w-8', 'h-8');
if (title.includes('paint')) return getIconFromIconName('Palette', color, 'w-8', 'h-8');
if (title.includes('pop')) return getIconFromIconName('Confetti', color, 'w-8', 'h-8');
if (title.includes('travel')) return getIconFromIconName('Jeep', color, 'w-8', 'h-8');
if (title.includes('learn')) return getIconFromIconName('Book', color, 'w-8', 'h-8');
if (title.includes('health')) return getIconFromIconName('Asclepius', color, 'w-8', 'h-8');
if (title.includes('fun')) return getIconFromIconName('Island', color, 'w-8', 'h-8');
if (title.includes('home')) return getIconFromIconName('House', color, 'w-8', 'h-8');
if (title.includes('language')) return getIconFromIconName('Translate', color, 'w-8', 'h-8');
if (title.includes('code')) return getIconFromIconName('Code', color, 'w-8', 'h-8');
else return getIconFromIconName('Lightbulb', color, 'w-8', 'h-8');
if (title.includes("automation")) return getIconFromIconName("Robot", color, "w-8", "h-8");
if (title.includes("online")) return getIconFromIconName("Globe", color, "w-8", "h-8");
if (title.includes("paint")) return getIconFromIconName("Palette", color, "w-8", "h-8");
if (title.includes("pop")) return getIconFromIconName("Confetti", color, "w-8", "h-8");
if (title.includes("travel")) return getIconFromIconName("Jeep", color, "w-8", "h-8");
if (title.includes("learn")) return getIconFromIconName("Book", color, "w-8", "h-8");
if (title.includes("health")) return getIconFromIconName("Asclepius", color, "w-8", "h-8");
if (title.includes("fun")) return getIconFromIconName("Island", color, "w-8", "h-8");
if (title.includes("home")) return getIconFromIconName("House", color, "w-8", "h-8");
if (title.includes("language")) return getIconFromIconName("Translate", color, "w-8", "h-8");
if (title.includes("code")) return getIconFromIconName("Code", color, "w-8", "h-8");
else return getIconFromIconName("Lightbulb", color, "w-8", "h-8");
}
interface SuggestionCardProps {
title: string;
body: string;
@@ -46,12 +37,17 @@ export default function SuggestionCard(data: SuggestionCardProps) {
<Card className={cardClassName}>
<CardHeader className="m-0 p-2 pb-1 relative">
<div className="flex flex-row md:flex-col">
{convertSuggestionTitleToIconClass(data.title.toLowerCase(), data.color.toLowerCase())}
{convertSuggestionTitleToIconClass(
data.title.toLowerCase(),
data.color.toLowerCase(),
)}
<CardTitle className={titleClassName}>{data.title}</CardTitle>
</div>
</CardHeader>
<CardContent className="m-0 p-2 pr-4 pt-1">
<CardDescription className={`${descriptionClassName} sm:line-clamp-2 md:line-clamp-4`}>
<CardDescription
className={`${descriptionClassName} sm:line-clamp-2 md:line-clamp-4`}
>
{data.body}
</CardDescription>
</CardContent>
@@ -62,5 +58,7 @@ export default function SuggestionCard(data: SuggestionCardProps) {
<a href={data.link} className="no-underline">
{cardContent}
</a>
) : cardContent;
) : (
cardContent
);
}