Skip to content

Commit

Permalink
chore: remove export from types, rename prop to id
Browse files Browse the repository at this point in the history
  • Loading branch information
aleksandar-r committed Mar 22, 2024
1 parent 7adf717 commit 72ef6aa
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions src/core/Accordion/component.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import React, { useState, ReactNode, JSX } from "react";
import Icon from "../Icon/component.jsx";
import Icon from "../Icon/component.tsx";

export type AccordionData = {
type AccordionData = {
name: string;
content: ReactNode;
};

export type AccordionRowProps = {
type AccordionRowProps = {
bottomBorder: boolean;
topBorder: boolean;
active: boolean;
Expand All @@ -19,12 +19,12 @@ export type AccordionRowProps = {
setActiveIndex: (index: number) => void;
};

export type AccordionProps = {
type AccordionProps = {
data: AccordionData[];
arrowIcon: boolean;
topBorder: boolean;
bottomBorder: boolean;
accordionInPageId: string;
id: string;
};

const AccordionRow = ({
Expand Down Expand Up @@ -105,19 +105,15 @@ const AccordionRow = ({

const Accordion = ({
data,
accordionInPageId = "id-accordion",
id = "id-accordion",
topBorder,
bottomBorder,
arrowIcon,
}: AccordionProps) => {
const [activeIndex, setActiveIndex] = useState(null);

return (
<div
className="ui-grid-mx max-w-screen-sm sm:mx-auto"
id={accordionInPageId}
style={{ paddingBottom: "8rem" }}
>
<div className="ui-grid-mx max-w-screen-sm sm:mx-auto" id={id}>
{data.map((item, currentIndex) => {
return (
<AccordionRow
Expand Down

0 comments on commit 72ef6aa

Please sign in to comment.