test
This commit is contained in:
32
src/entities/DefaultDropDown/DefaultDropDown.tsx
Normal file
32
src/entities/DefaultDropDown/DefaultDropDown.tsx
Normal 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>
|
||||
);
|
||||
};
|
1
src/entities/DefaultDropDown/index.ts
Normal file
1
src/entities/DefaultDropDown/index.ts
Normal file
@ -0,0 +1 @@
|
||||
export { DefaultDropDown } from "./DefaultDropDown"
|
Reference in New Issue
Block a user