feat(WEB-220): label translations
This commit is contained in:
@@ -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>
|
||||
</>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user