Raw
1 import React from "react"
2 import Link from "next/link"
3 import clsx from "clsx"
4 import { ArrowUpRightOnBox } from "@medusajs/icons"
5 import { EditDate } from "../EditDate"
6
7 type EditButtonProps = {
8 filePath: string
9 editDate?: string
10 }
11
12 export const EditButton = ({ filePath, editDate }: EditButtonProps) => {
13 return (
14 <div className="flex flex-wrap gap-docs_0.5 mt-docs_2 text-medusa-fg-subtle">
15 {editDate && <EditDate date={editDate} />}
16
17 <Link
18 href={`https://github.com/medusajs/medusa/edit/develop${filePath}`}
19 className={clsx(
20 "flex w-fit gap-docs_0.25 items-center",
21 "text-medusa-fg-subtle hover:text-medusa-fg-base",
22 "text-compact-small-plus"
23 )}
24 data-testid="edit-button"
25 >
26 <span>Edit this page</span>
27 <ArrowUpRightOnBox />
28 </Link>
29 </div>
30 )
31 }