feat(WEB-220): label translations

This commit is contained in:
Simon Emanuelsson
2024-05-22 10:27:16 +02:00
parent 125998efcf
commit de79c2dc80
80 changed files with 1104 additions and 460 deletions

View File

@@ -1,6 +1,7 @@
"use client"
import { useIntl } from "react-intl"
import { profile } from "@/constants/routes/myPages"
import { _ } from "@/lib/translation"
import { useProfileStore } from "@/stores/edit-profile"
import Button from "@/components/TempDesignSystem/Button"
@@ -9,26 +10,31 @@ import Link from "@/components/TempDesignSystem/Link"
import type { LangParams, PageArgs } from "@/types/params"
export default function EditProfile({ params }: PageArgs<LangParams>) {
const { formatMessage } = useIntl()
const isPending = useProfileStore((store) => store.pending)
const isValid = useProfileStore((store) => store.valid)
const cancel = formatMessage({ id: "Cancel" })
const save = formatMessage({ id: "Save" })
return (
<>
<Button
aria-label="Cancel"
aria-label={cancel}
asChild
form="edit-profile"
size="small"
type="reset"
>
<Link href={profile[params.lang]}>{_("Cancel")}</Link>
<Link href={profile[params.lang]}>{cancel}</Link>
</Button>
<Button
aria-label={save}
disabled={!isValid || isPending}
form="edit-profile"
size="small"
type="submit"
>
{_("Save")}
{save}
</Button>
</>
)