Skip to content

Commit

Permalink
fix: use translateProperty in UploadEditComponent
Browse files Browse the repository at this point in the history
  • Loading branch information
dziraf committed Aug 20, 2023
1 parent 08e4e3d commit 196b38c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/features/upload-file/components/UploadEditComponent.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { DropZone, DropZoneItem, FormGroup, Label } from '@adminjs/design-system'
import { EditPropertyProps, flat } from 'adminjs'
import { EditPropertyProps, flat, useTranslation } from 'adminjs'
import React, { FC, useEffect, useState } from 'react'
import PropertyCustom from '../types/property-custom.type.js'

const Edit: FC<EditPropertyProps> = ({ property, record, onChange }) => {
const { translateProperty } = useTranslation()
const { params } = record
const { custom } = property as unknown as { custom: PropertyCustom }

Expand Down Expand Up @@ -63,7 +64,7 @@ const Edit: FC<EditPropertyProps> = ({ property, record, onChange }) => {

return (
<FormGroup>
<Label>{property.label}</Label>
<Label>{translateProperty(property.label, property.resourceId)}</Label>
<DropZone
onChange={onUpload}
multiple={custom.multiple}
Expand Down

0 comments on commit 196b38c

Please sign in to comment.