Skip to content

Commit

Permalink
Linter and formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
SimaoNery committed Nov 28, 2024
1 parent b85f305 commit ac5235e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
17 changes: 8 additions & 9 deletions content-scripts/components/Accordion.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@ interface AccordionProps {
max_size: number;
}

export const Accordion = ({
id,
header,
max_size,
}: AccordionProps, ...children : (string | JSX.Element)[]): JSX.Element => {
export const Accordion = (
{ id, header, max_size }: AccordionProps,
...children: (string | JSX.Element)[]
): JSX.Element => {
const toggleAccordion = (event: MouseEvent) => {
const button: HTMLElement = event.currentTarget as HTMLElement;
const icon: HTMLElement = button.querySelector(`#${id} .se-card-header i`) as HTMLElement;
const icon: HTMLElement = button.querySelector(
`#${id} .se-card-header i`,
) as HTMLElement;
const innerContent = document.getElementById(`${id}-content`);

if (!innerContent || !icon) {
Expand Down Expand Up @@ -52,9 +53,7 @@ export const Accordion = ({
data-expanded="false"
onclick={toggleAccordion}
>
<div className="se-card-content">
{header}
</div>
<div className="se-card-content">{header}</div>
<i className="ri-arrow-down-s-line ri-2x"></i>
</button>

Expand Down
11 changes: 7 additions & 4 deletions content-scripts/pages/components_page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -240,8 +240,7 @@ export function createComponentsPage() {
>
<Accordion
id="example-accordion"
header=
{ <h3>Expandable Content</h3> }
header={<h3>Expandable Content</h3>}
max_size={200}
>
<p>This is the content of the accordion</p>
Expand All @@ -254,7 +253,11 @@ export function createComponentsPage() {
["Status", "Status"],
]}
data={[
["Button", "A button that can be clicked", "In progress"],
[
"Button",
"A button that can be clicked",
"In progress",
],
["Input", "A text input field", "Complete"],
]}
/>
Expand All @@ -274,7 +277,7 @@ interface ComponentProps {
}

const Component: JSX.Component<ComponentProps> = (
{name, description, code},
{ name, description, code },
children,
) => (
<div id={name} className="se-component-section">
Expand Down

0 comments on commit ac5235e

Please sign in to comment.