snowballtools-base/packages/frontend/src/components/Dropdown.tsx
Nabarun Gogoi e0001466e0
Implement functionality to create project using a template (#60)
* Create repository from selected template

* Create project based on created repository

* Replace dropdown component with component from material tailwind

* Remove repository name from query parameters
2024-02-08 09:20:49 +05:30

34 lines
672 B
TypeScript

import React from 'react';
import {
default as ReactDropdown,
Option as ReactDropdownOption,
} from 'react-dropdown';
import 'react-dropdown/style.css';
export interface Option {
value: string;
label: string;
}
interface DropdownProps {
options: Option[];
onChange: (arg: ReactDropdownOption) => void;
placeholder?: string;
value?: Option;
}
const Dropdown = ({ placeholder, options, onChange, value }: DropdownProps) => {
return (
<ReactDropdown
options={options}
placeholder={placeholder}
className="h-full"
controlClassName="h-full"
onChange={onChange}
value={value}
/>
);
};
export default Dropdown;