implementiran share by link
This commit is contained in:
21
app/ui/ViewBillBadge.tsx
Normal file
21
app/ui/ViewBillBadge.tsx
Normal file
@@ -0,0 +1,21 @@
|
||||
import { FC } from "react"
|
||||
import { Bill } from "@/app/lib/db-types"
|
||||
import Link from "next/link"
|
||||
import { DocumentIcon, TicketIcon } from "@heroicons/react/24/outline";
|
||||
import { useLocale } from "next-intl";
|
||||
|
||||
export interface ViewBillBadgeProps {
|
||||
locationId: string,
|
||||
bill: Bill
|
||||
};
|
||||
|
||||
export const ViewBillBadge: FC<ViewBillBadgeProps> = ({ locationId, bill: { _id: billId, name, paid, attachment } }) => {
|
||||
|
||||
const currentLocale = useLocale();
|
||||
|
||||
return (
|
||||
<Link href={`/${currentLocale}//share/bill/${locationId}-${billId}`} className={`badge badge-lg ${paid ? "badge-success" : " badge-outline"} ${!paid && !!attachment ? "btn-outline btn-success" : ""} cursor-pointer`}>
|
||||
<TicketIcon className="h-[1em] w-[1em] inline-block mr-1" /> {name}
|
||||
</Link>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user