mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-06 05:39:12 +00:00
Format next.js web app with prettier
This commit is contained in:
@@ -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
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user