mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-08 05:39:13 +00:00
Reorder automation card actions buttons. Put Delete action last
This commit is contained in:
@@ -291,17 +291,6 @@ function AutomationsCard(props: AutomationsCardProps) {
|
|||||||
<Button className='bg-background' variant={'ghost'}><DotsThreeVertical className='h-4 w-4' /></Button>
|
<Button className='bg-background' variant={'ghost'}><DotsThreeVertical className='h-4 w-4' /></Button>
|
||||||
</PopoverTrigger>
|
</PopoverTrigger>
|
||||||
<PopoverContent className='w-auto grid gap-2 text-left bg-secondary'>
|
<PopoverContent className='w-auto grid gap-2 text-left bg-secondary'>
|
||||||
<Button variant={'destructive'}
|
|
||||||
className='justify-start'
|
|
||||||
onClick={() => {
|
|
||||||
if (props.suggestedCard) {
|
|
||||||
setIsDeleted(true);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
deleteAutomation(automation.id.toString(), setIsDeleted);
|
|
||||||
}}>
|
|
||||||
<Trash className='h-4 w-4 mr-2' />Delete
|
|
||||||
</Button>
|
|
||||||
{
|
{
|
||||||
(!props.suggestedCard && props.locationData) && (
|
(!props.suggestedCard && props.locationData) && (
|
||||||
<AutomationComponentWrapper
|
<AutomationComponentWrapper
|
||||||
@@ -316,6 +305,18 @@ function AutomationsCard(props: AutomationsCardProps) {
|
|||||||
ipLocationData={props.locationData} />
|
ipLocationData={props.locationData} />
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
<ShareLink
|
||||||
|
buttonTitle="Share"
|
||||||
|
includeIcon={true}
|
||||||
|
buttonClassName='justify-start px-4 py-2 h-10'
|
||||||
|
buttonVariant={'outline' as keyof typeof buttonVariants}
|
||||||
|
title="Share Automation"
|
||||||
|
description="Copy the link below and share it with your coworkers or friends."
|
||||||
|
url={createShareLink(automation)}
|
||||||
|
onShare={() => {
|
||||||
|
navigator.clipboard.writeText(createShareLink(automation));
|
||||||
|
}}
|
||||||
|
/>
|
||||||
{
|
{
|
||||||
!props.suggestedCard && (
|
!props.suggestedCard && (
|
||||||
<Button variant={'outline'}
|
<Button variant={'outline'}
|
||||||
@@ -327,17 +328,17 @@ function AutomationsCard(props: AutomationsCardProps) {
|
|||||||
</Button>
|
</Button>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
<ShareLink
|
<Button variant={'destructive'}
|
||||||
buttonTitle="Share"
|
className='justify-start'
|
||||||
includeIcon={true}
|
onClick={() => {
|
||||||
buttonClassName='justify-start px-4 py-2 h-10'
|
if (props.suggestedCard) {
|
||||||
buttonVariant={'outline' as keyof typeof buttonVariants}
|
setIsDeleted(true);
|
||||||
title="Share Automation"
|
return;
|
||||||
description="Copy the link below and share it with your coworkers or friends."
|
}
|
||||||
url={createShareLink(automation)}
|
deleteAutomation(automation.id.toString(), setIsDeleted);
|
||||||
onShare={() => {
|
}}>
|
||||||
navigator.clipboard.writeText(createShareLink(automation));
|
<Trash className='h-4 w-4 mr-2' />Delete
|
||||||
}} />
|
</Button>
|
||||||
</PopoverContent>
|
</PopoverContent>
|
||||||
</Popover>
|
</Popover>
|
||||||
</CardTitle>
|
</CardTitle>
|
||||||
|
|||||||
Reference in New Issue
Block a user