fix:disable button

This commit is contained in:
Rama Priyanto 2025-06-09 16:56:30 +07:00
parent 3c5ce29060
commit a3538d1322
3 changed files with 53 additions and 44 deletions

View File

@ -21,6 +21,14 @@ export default function BasicPage() {
<AddIcon /> <AddIcon />
</Button> </Button>
</Link> */} </Link> */}
<Button
size="md"
className="bg-[#F07C00] text-white w-full lg:w-fit"
isDisabled
>
Tambah Artikel
<AddIcon />
</Button>
<ArticleTable /> <ArticleTable />
</div> </div>
</div> </div>

View File

@ -176,7 +176,7 @@ export default function MasterCategoryTable() {
<div className="overflow-x-hidden overflow-y-scroll"> <div className="overflow-x-hidden overflow-y-scroll">
<div className="px-2 md:px-4 md:py-4 w-full"> <div className="px-2 md:px-4 md:py-4 w-full">
<div className="bg-white shadow-lg dark:bg-[#18181b] rounded-xl p-3"> <div className="bg-white shadow-lg dark:bg-[#18181b] rounded-xl p-3">
{/* <Button <Button
size="md" size="md"
className="bg-[#F07C00] text-white w-full lg:w-fit" className="bg-[#F07C00] text-white w-full lg:w-fit"
onPress={onOpen} onPress={onOpen}
@ -184,7 +184,7 @@ export default function MasterCategoryTable() {
> >
Tambah Kategori Tambah Kategori
<AddIcon /> <AddIcon />
</Button> */} </Button>
<CategoriesTable triggerRefresh={refresh} /> <CategoriesTable triggerRefresh={refresh} />
</div> </div>
</div> </div>

View File

@ -82,7 +82,7 @@ export default function HeaderNews() {
<div className="w-full"> <div className="w-full">
<div className="flex flex-col lg:flex-row gap-3 lg:gap-8 bg-white dark:bg-black p-1 lg:p-8 lg:h-[540px] w-full lg:w-[75%] lg:mx-auto"> <div className="flex flex-col lg:flex-row gap-3 lg:gap-8 bg-white dark:bg-black p-1 lg:p-8 lg:h-[540px] w-full lg:w-[75%] lg:mx-auto">
<div className="lg:hidden w-[90%] h-[300px] md:h-[500px] mx-auto"> <div className="lg:hidden w-[90%] h-[300px] md:h-[500px] mx-auto">
{banner.length > 0 ? ( {banner?.length > 0 ? (
<Swiper <Swiper
centeredSlides={true} centeredSlides={true}
autoplay={{ autoplay={{
@ -222,7 +222,7 @@ export default function HeaderNews() {
</div> </div>
<div className="hidden lg:block w-full lg:w-[50%] h-[500px]"> <div className="hidden lg:block w-full lg:w-[50%] h-[500px]">
{banner.length > 0 ? ( {banner?.length > 0 ? (
<Swiper <Swiper
centeredSlides={true} centeredSlides={true}
autoplay={{ autoplay={{
@ -249,48 +249,49 @@ export default function HeaderNews() {
); );
}} }}
> >
{banner.map((newsItem: any, index: number) => ( {banner?.lenth > 0 &&
<SwiperSlide key={newsItem?.id} className="!w-full h-[50vh]"> banner.map((newsItem: any, index: number) => (
<Card <SwiperSlide key={newsItem?.id} className="!w-full h-[50vh]">
isFooterBlurred <Card
radius="lg" isFooterBlurred
className="border-none h-[50vh] lg:h-[500px] shadow-none" radius="lg"
> className="border-none h-[50vh] lg:h-[500px] shadow-none"
<Image >
alt="headernews" <Image
src={ alt="headernews"
newsItem?.thumbnailUrl == "" src={
? "/no-image.jpg" newsItem?.thumbnailUrl == ""
: newsItem?.thumbnailUrl ? "/no-image.jpg"
} : newsItem?.thumbnailUrl
className="!w-full !h-[500px] !object-cover !rounded-none" }
/> className="!w-full !h-[500px] !object-cover !rounded-none"
/>
<CardFooter className="mb-1 max-h-[20vh] before:bg-white/10 border-white/20 border-1 overflow-hidden py-1 md:absolute before:rounded-xl rounded-large bottom-1 w-[calc(100%_-_8px)] shadow-small ml-1 z-10"> <CardFooter className="mb-1 max-h-[20vh] before:bg-white/10 border-white/20 border-1 overflow-hidden py-1 md:absolute before:rounded-xl rounded-large bottom-1 w-[calc(100%_-_8px)] shadow-small ml-1 z-10">
<div className="text-white"> <div className="text-white">
<Link <Link
href={`news/detail/${newsItem.id}-${newsItem?.slug}`} href={`news/detail/${newsItem.id}-${newsItem?.slug}`}
> >
<p className="text-left font-semibold text-lg lg:text-2xl"> <p className="text-left font-semibold text-lg lg:text-2xl">
{textEllipsis(newsItem.title, 40)} {textEllipsis(newsItem.title, 40)}
</p> </p>
</Link> </Link>
<div className="flex flex-row gap-1"> <div className="flex flex-row gap-1">
<p className="py-[2px] text-left text-sm"> <p className="py-[2px] text-left text-sm">
{convertDateFormat(newsItem.createdAt)} WIB {convertDateFormat(newsItem.createdAt)} WIB
</p> </p>
<p className="flex items-center gap-1 text-sm"> <p className="flex items-center gap-1 text-sm">
<EyeIcon /> <EyeIcon />
{newsItem.viewCount === null {newsItem.viewCount === null
? 0 ? 0
: newsItem.viewCount} : newsItem.viewCount}
</p> </p>
</div>
</div> </div>
</div> </CardFooter>
</CardFooter> </Card>
</Card> </SwiperSlide>
</SwiperSlide> ))}
))}
</Swiper> </Swiper>
) : ( ) : (
<Skeleton className="rounded-lg"> <Skeleton className="rounded-lg">