This commit is contained in:
Mikola
2023-12-15 13:25:44 +03:00
parent 78f796b59d
commit 2aa6cb90f9
69 changed files with 1497 additions and 2047 deletions

View File

@@ -0,0 +1,32 @@
import React from "react";
import Dropdown from 'react-bootstrap/Dropdown';
type option = {
name: string,
link: string,
id: number
}
interface DefaultDropDownProps {
title: string,
options: option[]
}
export const DefaultDropDown:React.FC<DefaultDropDownProps> = ({title, options}) => {
return (
<Dropdown data-bs-theme="dark">
<Dropdown.Toggle id="dropdown-button-dark-example" variant="primary">
{title}
</Dropdown.Toggle>
<Dropdown.Menu>
{options.map((option => {
return <Dropdown.Item key={option.id} href={option.link}>
{option.name}
</Dropdown.Item>
}))}
</Dropdown.Menu>
</Dropdown>
);
};

View File

@@ -0,0 +1 @@
export { DefaultDropDown } from "./DefaultDropDown"

View File

@@ -0,0 +1,24 @@
import React, {ReactElement} from "react";
import Pagination from 'react-bootstrap/Pagination';
interface DefaultPaginationProps {
pageCount: number,
currentPage: number
}
export const DefaultPagination:React.FC<DefaultPaginationProps> = ({pageCount, currentPage}) => {
let items: ReactElement[] = [];
for (let number = 1; number <= pageCount; number++) {
items.push(
<Pagination.Item key={number} active={number === currentPage}>
{number}
</Pagination.Item>,
);
}
return (
<Pagination>
{items}
</Pagination>
);
};

View File

@@ -0,0 +1 @@
export { DefaultPagination } from "./DefaultPagination"