feat: remove unused FlashMessage component and banner data

This commit is contained in:
Ardeman 2025-03-12 19:27:04 +08:00
parent 634073342b
commit 0545190497
2 changed files with 0 additions and 88 deletions

View File

@ -1,37 +0,0 @@
import { useState, useEffect } from 'react'
type FlashMessageProperties = {
message: string
type: 'success' | 'error' | 'info'
}
export default function FlashMessage({
message,
type,
}: FlashMessageProperties) {
const [visible, setVisible] = useState<boolean>(false)
useEffect(() => {
if (message) {
setVisible(true)
const timer = setTimeout(() => setVisible(false), 3000)
return () => clearTimeout(timer)
}
}, [message])
if (!visible) return
const messageStyles = {
success: 'bg-green-100 text-green-800 border-green-300',
error: 'bg-red-100 text-red-800 border-red-300',
info: 'bg-blue-100 text-blue-800 border-blue-300',
}
return (
<div
className={`fixed top-4 right-4 rounded-lg border p-4 shadow-lg ${messageStyles[type]}`}
>
{message}
</div>
)
}

View File

@ -1,51 +0,0 @@
type TBanner = {
id: number
urlImage: string
alt: string
link: string
status: 'active' | 'draft' | 'inactive'
createdAt?: string
}
export const BANNER: TBanner[] = [
{
id: 1,
urlImage: '/images/banner.png',
alt: 'banner',
link: '/category/spotlight',
status: 'active',
createdAt: '2021-08-01',
},
{
id: 2,
urlImage: 'https://placehold.co/1000x65.png',
alt: 'banner',
status: 'draft',
link: '/#',
createdAt: '2021-08-01',
},
{
id: 3,
urlImage: 'https://placehold.co/1000x65.png',
alt: 'banner',
status: 'draft',
link: '/#',
createdAt: '2021-08-01',
},
{
id: 4,
urlImage: '/images/banner.png',
alt: 'banner',
link: '/#',
status: 'active',
createdAt: '2021-08-01',
},
{
id: 5,
urlImage: '/images/banner.png',
alt: 'banner',
link: '/#',
status: 'inactive',
createdAt: '2021-08-01',
},
]