Fix: Avatar
Deskripsi: - Avatar job - Avatar collaboration - Avatar event ## No Issuue
This commit is contained in:
@@ -1,37 +1,40 @@
|
||||
"use client";
|
||||
|
||||
import { RouterJob } from "@/app/lib/router_hipmi/router_job";
|
||||
import { Button, Center, Stack } from "@mantine/core";
|
||||
import { useShallowEffect } from "@mantine/hooks";
|
||||
import { IconBrandWhatsapp } from "@tabler/icons-react";
|
||||
import Link from "next/link";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { useState } from "react";
|
||||
import ComponentJob_DetailData from "../../component/detail/detail_data";
|
||||
import { MODEL_JOB } from "../../model/interface";
|
||||
|
||||
export default function Job_MainDetail({
|
||||
dataJob,
|
||||
hostName,
|
||||
}: {
|
||||
dataJob: MODEL_JOB;
|
||||
hostName: string;
|
||||
}) {
|
||||
export default function Job_MainDetail({ dataJob }: { dataJob: MODEL_JOB }) {
|
||||
return (
|
||||
<>
|
||||
<Stack>
|
||||
<ComponentJob_DetailData data={dataJob} />
|
||||
<ButtonAction jobId={dataJob.id} hostName={hostName} />
|
||||
<ButtonAction jobId={dataJob.id} />
|
||||
</Stack>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
function ButtonAction({
|
||||
jobId,
|
||||
hostName,
|
||||
}: {
|
||||
jobId: string;
|
||||
hostName: string;
|
||||
}) {
|
||||
const router = useRouter();
|
||||
function ButtonAction({ jobId }: { jobId: string }) {
|
||||
const [origin, setOrigin] = useState("");
|
||||
|
||||
useShallowEffect(() => {
|
||||
onLoadOrigin(setOrigin);
|
||||
// if (typeof window !== "undefined") {
|
||||
// setOrigin(window.location.origin);
|
||||
// }
|
||||
}, [setOrigin]);
|
||||
|
||||
async function onLoadOrigin(setOrigin: any) {
|
||||
const res = await fetch("/api/zz-makuro");
|
||||
const result = await res.json();
|
||||
setOrigin(result.origin);
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
@@ -44,8 +47,7 @@ function ButtonAction({
|
||||
>
|
||||
<Link
|
||||
style={{ textDecoration: "none", color: "white" }}
|
||||
href={`whatsapp://send?text=Job Vacancy HIPMI BADUNG : ${hostName}/dev/job/non_user_view/${jobId}`}
|
||||
// href={`https://t.me/share/url?url={${"http://localhost:3000/dev/job/non_user_view"}}&text={Lowongan Kerja Ini}`}
|
||||
href={`whatsapp://send?text=Job Vacancy HIPMI BADUNG : ${origin}${RouterJob.job_vacancy_non_user({ id: jobId })}`}
|
||||
>
|
||||
Bagikan ke WhatsApp
|
||||
</Link>
|
||||
|
||||
Reference in New Issue
Block a user