Skip to content

Commit

Permalink
feat: add icons for the accordion
Browse files Browse the repository at this point in the history
  • Loading branch information
brolag committed Aug 7, 2024
1 parent df30a09 commit e97bb73
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions packages/nextjs/components/ui/AccourdionItem.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"use client";

import { ReactElement, useState } from "react";
import Image from "next/image";

type AccordionItemProps = {
title: string;
Expand All @@ -16,8 +17,15 @@ const AccordionItem = ({ title, content }: AccordionItemProps) => {

return (
<div className="my-2 border border-gray-700 rounded-lg">
<div className="p-4 cursor-pointer bg-gray-800 text-white rounded-t-lg" onClick={toggleAccordion}>
{title}
<div
className="p-4 cursor-pointer bg-gray-800 text-white rounded-t-lg flex items-center justify-between"
onClick={toggleAccordion}
>
<div className="flex items-center">
<Image src="/images/empty_star.png" alt="Star" width={16} height={16} className="mr-2" />
{title}
</div>
<div>{isOpen ? "▼" : "▶"}</div>
</div>
{isOpen && <div className="p-4 bg-gray-900 text-white rounded-b-lg">{content}</div>}
</div>
Expand Down
Binary file added packages/nextjs/public/images/empty_star.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit e97bb73

Please sign in to comment.