PresetActions() — ui Function Reference
Architecture documentation for the PresetActions() function in preset-actions.tsx from the ui codebase.
Entity Profile
Dependency Diagram
graph TD 9db3f597_12cf_834e_12c7_63d3aa6c95c0["PresetActions()"] 60ce299c_13bd_f6c6_b9b9_09596553148a["preset-actions.tsx"] 9db3f597_12cf_834e_12c7_63d3aa6c95c0 -->|defined in| 60ce299c_13bd_f6c6_b9b9_09596553148a style 9db3f597_12cf_834e_12c7_63d3aa6c95c0 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
apps/v4/app/(app)/examples/playground/components/preset-actions.tsx lines 36–121
export function PresetActions() {
const [open, setIsOpen] = React.useState(false)
const [showDeleteDialog, setShowDeleteDialog] = React.useState(false)
return (
<>
<DropdownMenu>
<DropdownMenuTrigger asChild>
<Button variant="secondary" size="icon">
<span className="sr-only">Actions</span>
<MoreHorizontal />
</Button>
</DropdownMenuTrigger>
<DropdownMenuContent align="end">
<DropdownMenuItem onSelect={() => setIsOpen(true)}>
Content filter preferences
</DropdownMenuItem>
<DropdownMenuSeparator />
<DropdownMenuItem
onSelect={() => setShowDeleteDialog(true)}
className="text-red-600"
>
Delete preset
</DropdownMenuItem>
</DropdownMenuContent>
</DropdownMenu>
<Dialog open={open} onOpenChange={setIsOpen}>
<DialogContent>
<DialogHeader>
<DialogTitle>Content filter preferences</DialogTitle>
<DialogDescription>
The content filter flags text that may violate our content policy.
It's powered by our moderation endpoint which is free to use
to moderate your OpenAI API traffic. Learn more.
</DialogDescription>
</DialogHeader>
<div className="py-6">
<h4 className="text-muted-foreground text-sm">
Playground Warnings
</h4>
<div className="flex items-start justify-between gap-4 pt-3">
<Switch name="show" id="show" defaultChecked={true} />
<Label className="grid gap-1 font-normal" htmlFor="show">
<span className="font-semibold">
Show a warning when content is flagged
</span>
<span className="text-muted-foreground text-sm">
A warning will be shown when sexual, hateful, violent or
self-harm content is detected.
</span>
</Label>
</div>
</div>
<DialogFooter>
<DialogClose asChild>
<Button variant="secondary">Close</Button>
</DialogClose>
</DialogFooter>
</DialogContent>
</Dialog>
<AlertDialog open={showDeleteDialog} onOpenChange={setShowDeleteDialog}>
<AlertDialogContent>
<AlertDialogHeader>
<AlertDialogTitle>Are you absolutely sure?</AlertDialogTitle>
<AlertDialogDescription>
This action cannot be undone. This preset will no longer be
accessible by you or others you've shared it with.
</AlertDialogDescription>
</AlertDialogHeader>
<AlertDialogFooter>
<AlertDialogCancel>Cancel</AlertDialogCancel>
<Button
variant="destructive"
onClick={() => {
setShowDeleteDialog(false)
toast.success("This preset has been deleted.")
}}
>
Delete
</Button>
</AlertDialogFooter>
Domain
Subdomains
Source
Frequently Asked Questions
What does PresetActions() do?
PresetActions() is a function in the ui codebase, defined in apps/v4/app/(app)/examples/playground/components/preset-actions.tsx.
Where is PresetActions() defined?
PresetActions() is defined in apps/v4/app/(app)/examples/playground/components/preset-actions.tsx at line 36.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free