mirror of
https://github.com/shadcn-ui/ui.git
synced 2026-07-09 06:55:07 +00:00
61 lines
1.7 KiB
TypeScript
61 lines
1.7 KiB
TypeScript
"use client"
|
|
|
|
import { PopoverProps } from "@radix-ui/react-popover"
|
|
import { Clipboard, Copy } from "lucide-react"
|
|
|
|
import { Button } from "@/components/ui/button"
|
|
import {
|
|
Dialog,
|
|
DialogContent,
|
|
DialogDescription,
|
|
DialogFooter,
|
|
DialogHeader,
|
|
DialogTitle,
|
|
DialogTrigger,
|
|
} from "@/components/ui/dialog"
|
|
import { Input } from "@/components/ui/input"
|
|
import { Label } from "@/components/ui/label"
|
|
import {
|
|
Popover,
|
|
PopoverContent,
|
|
PopoverTrigger,
|
|
} from "@/components/ui/popover"
|
|
|
|
export function PresetShare() {
|
|
return (
|
|
<Popover>
|
|
<PopoverTrigger asChild>
|
|
<Button variant="subtle">Share</Button>
|
|
</PopoverTrigger>
|
|
<PopoverContent align="end" className="w-[520px]">
|
|
<div className="flex flex-col space-y-2 text-center sm:text-left">
|
|
<h3 className="text-lg font-semibold text-slate-900 dark:text-slate-50">
|
|
Share preset
|
|
</h3>
|
|
<p className="text-sm text-slate-500 dark:text-slate-400">
|
|
Anyone who has this link and an OpenAI account will be able to view
|
|
this.
|
|
</p>
|
|
</div>
|
|
<div className="flex items-center space-x-2 pt-4">
|
|
<div className="grid flex-1 gap-2">
|
|
<Label htmlFor="link" className="sr-only">
|
|
Link
|
|
</Label>
|
|
<Input
|
|
id="link"
|
|
defaultValue="https://platform.openai.com/playground/p/7bbKYQvsVkNmVb8NGcdUOLae?model=text-davinci-003"
|
|
readOnly
|
|
className="h-9"
|
|
/>
|
|
</div>
|
|
<Button type="submit" size="sm" className="px-3">
|
|
<span className="sr-only">Copy</span>
|
|
<Copy className="h-4 w-4" />
|
|
</Button>
|
|
</div>
|
|
</PopoverContent>
|
|
</Popover>
|
|
)
|
|
}
|