Before Width: | Height: | Size: 931 B After Width: | Height: | Size: 931 B |
Before Width: | Height: | Size: 36 KiB After Width: | Height: | Size: 36 KiB |
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 37 KiB |
Before Width: | Height: | Size: 36 KiB After Width: | Height: | Size: 36 KiB |
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 28 KiB |
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 33 KiB |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
@ -0,0 +1,28 @@ |
|||||||
|
import React, { useState } from "react"; |
||||||
|
|
||||||
|
import CurrentDateShamsi from "./CurrentDateShamsi"; |
||||||
|
import CurrentTime from "./CurrentTime"; |
||||||
|
|
||||||
|
function CurrentDateTime() { |
||||||
|
const list = { |
||||||
|
1: <CurrentDateShamsi />, |
||||||
|
2: <CurrentTime />, |
||||||
|
}; |
||||||
|
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 CurrentDateTime; |