Skip to content

Commit

Permalink
General Enum
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasAunvik committed Apr 27, 2024
1 parent 12c776b commit 47e69fb
Showing 1 changed file with 50 additions and 50 deletions.
100 changes: 50 additions & 50 deletions Web/Client/components/skills/SkillGeneralList.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { replaceCDN } from "@/components/constants";
import {
Accordion,
AccordionContent,
AccordionItem,
AccordionTrigger,
Accordion,
AccordionContent,
AccordionItem,
AccordionTrigger,
} from "@/components/ui/accordion";
import { Skeleton } from "@/components/ui/skeleton";
import { type ISkill, SkillSummon } from "@/lib/models/skill/SkillModel";
Expand All @@ -12,54 +12,54 @@ import Image from "next/image";
import Link from "next/link";

export interface SkillGeneralListProps {
skills: ISkill[];
skills: ISkill[];
}

export const SkillGeneralList = (props: SkillGeneralListProps) => {
const { skills } = props;
const { skills } = props;

return (
<div>
<Accordion type="single" collapsible>
<AccordionItem value="otherskills">
<AccordionTrigger>General Skills</AccordionTrigger>
<AccordionContent>
{!skills ? (
<div>
<LoaderCircle className="animate-spin" />
<span className="sr-only">Loading...</span>
</div>
) : (
<ul className="flex flex-col gap-4">
{skills
.filter((s) => s.summon === SkillSummon.None)
.map((s) => {
return (
<li key={`skill-${s.id}`}>
<Link
href={`/dashboard/skills/${s.id}`}
className="flex flex-row"
>
{s.iconUrl ? (
<Image
alt={`Skill ${s.name} Image`}
src={replaceCDN(s.iconUrl)}
width={40}
height={40}
/>
) : (
<Skeleton className="h-10 w-10" />
)}
<span className="mt-2 ml-4 text-base">{s.name}</span>
</Link>
</li>
);
})}
</ul>
)}
</AccordionContent>
</AccordionItem>
</Accordion>
</div>
);
return (
<div>
<Accordion type="single" collapsible>
<AccordionItem value="otherskills">
<AccordionTrigger>General Skills</AccordionTrigger>
<AccordionContent>
{!skills ? (
<div>
<LoaderCircle className="animate-spin" />
<span className="sr-only">Loading...</span>
</div>
) : (
<ul className="flex flex-col gap-4">
{skills
.filter((s) => s.summon === SkillSummon.General)
.map((s) => {
return (
<li key={`skill-${s.id}`}>
<Link
href={`/dashboard/skills/${s.id}`}
className="flex flex-row"
>
{s.iconUrl ? (
<Image
alt={`Skill ${s.name} Image`}
src={replaceCDN(s.iconUrl)}
width={40}
height={40}
/>
) : (
<Skeleton className="h-10 w-10" />
)}
<span className="mt-2 ml-4 text-base">{s.name}</span>
</Link>
</li>
);
})}
</ul>
)}
</AccordionContent>
</AccordionItem>
</Accordion>
</div>
);
};

0 comments on commit 47e69fb

Please sign in to comment.