You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

35 lines
786 B

import React, { useState } from "react";
import Blog1 from "./design1";
import Blog2 from "./design2";
import Blog3 from "./design3";
import Blog4 from "./design4";
import Blog5 from "./design5";
import Blog6 from "./design6";
function Blogs() {
const list = {
1: <Blog1 />,
2: <Blog2 />,
3: <Blog3 />,
4: <Blog4 />,
5: <Blog5 />,
6: <Blog6 />,
};
const [type, setType] = useState(1);
return (
<div className="w-full flex flex-col items-center">
<select
className="b-10 w-20 bg-gray-200"
onChange={(e) => setType(e.target.value)}
>
{Object.keys(list).map((option, index) => (
<option key={index}>{option}</option>
))}
</select>
{list[type]}
</div>
);
}
export default Blogs;