fix space translations (#826)

This commit is contained in:
Philip Okugbe
2025-03-07 00:03:57 +00:00
committed by GitHub
parent 1988feb9ce
commit 8826cca539
4 changed files with 35 additions and 15 deletions

View File

@ -2,6 +2,8 @@ import { IconCheck } from "@tabler/icons-react";
import { Group, Select, SelectProps, Text } from "@mantine/core";
import React from "react";
import { spaceRoleData } from "@/features/space/types/space-role-data.ts";
import { useTranslation } from "react-i18next";
import { IRoleData } from "@/lib/types.ts";
const iconProps = {
stroke: 1.5,
@ -38,9 +40,15 @@ export function SpaceMemberRole({
defaultRole,
label,
}: SpaceMemberRoleProps) {
const { t } = useTranslation();
return (
<Select
data={spaceRoleData}
data={spaceRoleData.map((role: IRoleData) => ({
label: t(role.label),
value: role.value,
description: t(role.description),
}))}
defaultValue={defaultRole}
label={label}
onChange={onSelect}