Fix selection of icons, colors, add examples for personal finance

This commit is contained in:
sabaimran
2024-08-05 12:08:18 +05:30
parent af6a70c9fb
commit f835e330b8
3 changed files with 99 additions and 19 deletions

View File

@@ -2,23 +2,9 @@
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";
import { convertSuggestionTitleToIconClass } from "./suggestionsData";
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");
}
interface SuggestionCardProps {
title: string;
@@ -38,7 +24,7 @@ export default function SuggestionCard(data: SuggestionCardProps) {
<CardHeader className="m-0 p-2 pb-1 relative">
<div className="flex flex-row md:flex-col">
{convertSuggestionTitleToIconClass(
data.title.toLowerCase(),
data.title,
data.color.toLowerCase(),
)}
<CardTitle className={titleClassName}>{data.title}</CardTitle>