-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
asset filter in home, button "cambiar" on csv selectable link variant,
button publish and unpublish on form asset, add next button to form
- Loading branch information
Showing
17 changed files
with
307 additions
and
78 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
import React from "react"; | ||
import { Button, buttonVariants } from "@/components/ui/button"; | ||
import { Pencil, Archive, ArchiveX, BookX, BookUp } from "lucide-react"; | ||
import Link from "next/link"; | ||
import { | ||
archiveAsset, | ||
togglePublish, | ||
} from "@/lib/actions/admin/asset-actions/asset"; | ||
import { ToastAction } from "@/components/ui/toast"; | ||
import { | ||
Tooltip, | ||
TooltipContent, | ||
TooltipTrigger, | ||
} from "@/components/ui/tooltip"; | ||
import { useToast } from "@/components/ui/use-toast"; | ||
|
||
const CardActions = ({ asset, pathname }) => { | ||
const { toast } = useToast(); | ||
return ( | ||
<div className="flex flex-col gap-2"> | ||
<Tooltip delayDuration={300}> | ||
<TooltipTrigger> | ||
<Link href={`/admin/bien/editar/${asset._id}`}> | ||
<Pencil /> | ||
</Link> | ||
</TooltipTrigger> | ||
<TooltipContent> | ||
<p>Editar</p> | ||
</TooltipContent> | ||
</Tooltip> | ||
<Tooltip> | ||
<TooltipTrigger> | ||
<div | ||
onClick={() => | ||
toast({ | ||
description: `Confirmar para ${ | ||
pathname.includes("archivados") ? "des" : "" | ||
}archivar el bien`, | ||
action: ( | ||
<ToastAction | ||
onClick={() => archiveAsset(asset._id)} | ||
altText="Confirmar" | ||
> | ||
Confirmar | ||
</ToastAction> | ||
), | ||
}) | ||
} | ||
> | ||
{pathname.includes("archivados") ? <ArchiveX /> : <Archive />} | ||
</div> | ||
</TooltipTrigger> | ||
<TooltipContent> | ||
<p>{asset.archivedAt ? "Desarchivar" : "Archivar"}</p> | ||
</TooltipContent> | ||
</Tooltip> | ||
<Tooltip> | ||
<TooltipTrigger> | ||
<div | ||
type="button" | ||
onClick={() => { | ||
togglePublish(asset._id); | ||
}} | ||
className="submitButton w-full my-2" | ||
> | ||
{asset.publish ? <BookX /> : <BookUp />} | ||
</div> | ||
</TooltipTrigger> | ||
<TooltipContent> | ||
<p>{asset.publish ? "Despublicar" : "Publicar"}</p> | ||
</TooltipContent> | ||
</Tooltip> | ||
</div> | ||
); | ||
}; | ||
|
||
export default CardActions; |
Oops, something went wrong.