parent
18e7495e00
commit
91c964b3f4
3 changed files with 30 additions and 5 deletions
@ -0,0 +1,25 @@ |
||||
import React, { useState } from "react"; |
||||
|
||||
import Recharts from "./Recharts"; |
||||
|
||||
function Blogs() { |
||||
const list = { |
||||
1: <Recharts />, |
||||
}; |
||||
const [type, setType] = useState(1); |
||||
return ( |
||||
<div className="w-full flex flex-col items-center"> |
||||
<select |
||||
className="w-20 bg-gray-200 mb-10" |
||||
onChange={(e) => setType(e.target.value)} |
||||
> |
||||
{Object.keys(list).map((option, index) => ( |
||||
<option key={index}>{option}</option> |
||||
))} |
||||
</select> |
||||
{list[type]} |
||||
</div> |
||||
); |
||||
} |
||||
|
||||
export default Blogs; |
Loading…
Reference in new issue