quintodrome/ui/src/share/ShareEdit.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

34 lines
1,003 B
JavaScript
Raw Normal View History

2023-01-19 18:52:55 -09:00
import {
2023-01-23 10:50:02 -09:00
DateTimeInput,
2023-01-19 18:52:55 -09:00
Edit,
NumberField,
SimpleForm,
TextInput,
} from 'react-admin'
import { shareUrl } from '../utils'
import { Link } from '@material-ui/core'
2023-01-23 10:50:02 -09:00
import { DateField } from '../common'
2023-01-19 18:52:55 -09:00
export const ShareEdit = (props) => {
2023-01-24 09:04:00 -09:00
const { id, basePath, hasCreate, ...rest } = props
2023-01-19 18:52:55 -09:00
const url = shareUrl(id)
return (
<Edit {...props}>
2023-01-24 09:04:00 -09:00
<SimpleForm {...rest}>
2023-01-19 18:52:55 -09:00
<Link source="URL" href={url} target="_blank" rel="noopener noreferrer">
{url}
</Link>
<TextInput source="description" />
2023-01-23 10:50:02 -09:00
<DateTimeInput source="expiresAt" />
2023-01-19 18:52:55 -09:00
<TextInput source="contents" disabled />
<TextInput source="format" disabled />
<TextInput source="maxBitRate" disabled />
<TextInput source="username" disabled />
<NumberField source="visitCount" disabled />
2023-01-23 10:50:02 -09:00
<DateField source="lastVisitedAt" disabled showTime />
<DateField source="createdAt" disabled showTime />
2023-01-19 18:52:55 -09:00
</SimpleForm>
</Edit>
)
}