-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
/
Copy pathpage.tsx
61 lines (56 loc) · 2.14 KB
/
page.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
import {Fragment} from 'react';
import Link from 'next/link';
import {createChangelog} from 'sentry-docs/actions/changelog';
import {FileUpload} from 'sentry-docs/components/changelog/fileUpload';
import {ForwardRefEditor} from 'sentry-docs/components/changelog/forwardRefEditor';
import {TitleSlug} from 'sentry-docs/components/changelog/titleSlug';
import {Button} from 'sentry-docs/components/changelog/ui/Button';
import {Select} from 'sentry-docs/components/changelog/ui/Select';
import {prisma} from 'sentry-docs/prisma';
export default async function ChangelogCreatePage() {
const categories = await prisma.category.findMany();
return (
<section className="overflow-x-auto col-start-3 col-span-8">
<form action={createChangelog} className="px-2 w-full">
<TitleSlug />
<FileUpload />
<div className="my-6">
<label htmlFor="summary" className="block text-xs font-medium text-gray-700">
Summary
<Fragment>
<span className="font-bold text-secondary">*</span>
</Fragment>
</label>
<textarea name="summary" className="w-full" required />
<span className="text-xs text-gray-500 italic">
This will be shown in the list
</span>
</div>
<div>
<Select
name="categories"
className="mt-1 mb-6"
label="Category"
placeholder="Select Category"
options={categories.map(category => ({
label: category.name,
value: category.name,
}))}
isMulti
/>
</div>
<ForwardRefEditor name="content" className="w-full" />
<footer className="flex items-center justify-between mt-2">
<Link href="/changelog/_admin" className="underline text-gray-500">
Return to Changelogs list
</Link>
<div>
<Button type="submit">Create (not published yet)</Button>
<br />
<span className="text-xs text-gray-500 italic">You can publish it later</span>
</div>
</footer>
</form>
</section>
);
}