-
Notifications
You must be signed in to change notification settings - Fork 0
/
StatusRadioGroup.tsx
48 lines (45 loc) · 1.27 KB
/
StatusRadioGroup.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import IconCover from "@/components/ui/IconCover";
import { statusInfo } from "@/constants";
import type { $Enums } from "@prisma/client";
import Image from "next/image";
import React from "react";
type Props = {
defaultValue: $Enums.Status;
};
const StatusRadioGroup = ({ defaultValue }: Props) => {
return (
<div className="status-radio-group">
{Object.entries(statusInfo).map(([key, value]) => (
<div key={key}>
<input
type="radio"
id={key}
name="status"
value={key}
defaultChecked={key === defaultValue}
/>
<label htmlFor={key}>
<IconCover bg={value.iconBg}>
<Image
src={value.icon}
alt={`${key} icon`}
width={25}
height={25}
/>
</IconCover>
{value.title}
<span className="bg-[#3662E3] rounded-full h-[20px] w-[20px] flex items-center justify-center ml-auto">
<Image
src="/assets/Done_round.svg"
alt=""
width={13}
height={13}
/>
</span>
</label>
</div>
))}
</div>
);
};
export default StatusRadioGroup;