Added default language in user edit

This commit is contained in:
rockyeverlast
2025-09-17 12:23:55 +05:30
parent 8966295260
commit 248980d24b
3 changed files with 34 additions and 55 deletions

View File

@@ -274,7 +274,7 @@ function EditRegisterUsers({ data, refetch }: { data: UserData, refetch: () => v
</Box>
<Field.Label color="black" pt={1} fontSize="12px">
Language
Default Language
</Field.Label>
{/* <Input
bgColor="#EEEEEE"
@@ -295,57 +295,36 @@ function EditRegisterUsers({ data, refetch }: { data: UserData, refetch: () => v
/> */}
<HStack>
{[
{ id: 1, label: "English" },
{ id: 2, label: "Hindi" },
{ id: 4, label: "Other" },
].map((lang) => (
<label
key={lang.id}
<select
style={{
display: "flex",
alignItems: "center",
width: "100%",
background: "transparent",
color: "black",
border: "none",
fontSize: "12px",
color: "#000",
marginBottom: "8px",
gap: "8px",
height: "30px",
outline: "none",
}}
>
<input
type="checkbox"
className="custom-checkbox"
value={lang.id}
checked={formData?.principle_language_linkss?.language_xid?.includes(lang.id) || false}
value={formData?.principle_language_linkss?.language_xid?.[0] || ""}
onChange={(e) => {
const selected = formData?.principle_language_linkss?.language_xid || [];
const value = Number(e.target.value);
const updated = e.target.checked
? [...selected, value]
: selected.filter((id) => id !== value);
setFormData({
...formData,
principle_language_linkss: {
...formData?.principle_language_linkss,
language_xid: updated,
language_xid: [value],
},
});
}}
style={{
width: "16px",
height: "16px",
border: "2px solid black",
backgroundColor: "#fff",
appearance: "none",
cursor: "pointer",
position: "relative",
}}
/>
{lang.label}
</label>
))}
>
<option value="1">English</option>
<option value="2">Hindi</option>
<option value="3">Marathi</option>
<option value="4">Telgu</option>
<option value="5">Tamil</option>
<option value="6">Bengali</option>
<option value="7">Odia</option>
</select>
</HStack>
</Field.Root>
</Stack>

View File

@@ -29,7 +29,7 @@ const tableHeadRow = [
"Gender",
"DOB",
"Type Of User",
"Language",
"Default Language",
"Active/Deactive",
"Action",
];
@@ -160,7 +160,7 @@ const RegisterUsers = () => {
"Gender": agency.gender,
"DOB": agency.date_of_birth ? new Date(agency.date_of_birth).toLocaleDateString('en-GB').replace(/\//g, '-') : 'N/A',
"Type Of User": agency.principal_type?.principal_type_title || 'N/A',
"Language": agency?.principle_language_linkss?.language?.language_name,
"Default Language": agency?.principle_language_linkss?.language?.language_name,
"Active/Deactive": agency.is_active === true ? 'Active' : 'Inactive',
"Action": (
<HStack justifyContent="center">

View File

@@ -103,7 +103,7 @@ function ViewRegisterUsers({ data }: { data: UserData }) {
/>
<Field.Label color="black" pt={1} fontSize="12px">
Language
Default Language
</Field.Label>
<Input
bgColor="#EEEEEE" color="black" border="none" pl={1} fontSize="12px" height="30px"