|
|
@ -1,13 +1,8 @@ |
|
|
|
import { |
|
|
|
import { EyeIcon, FlagIcon, FrownIcon, SmileIcon } from 'lucide-react'; |
|
|
|
CheckIcon, |
|
|
|
|
|
|
|
EyeIcon, |
|
|
|
|
|
|
|
FlagIcon, |
|
|
|
|
|
|
|
FrownIcon, |
|
|
|
|
|
|
|
SmileIcon, |
|
|
|
|
|
|
|
XIcon, |
|
|
|
|
|
|
|
} from 'lucide-react'; |
|
|
|
|
|
|
|
import { cn } from '../../../lib/classname'; |
|
|
|
import { cn } from '../../../lib/classname'; |
|
|
|
import type { GetRoadmapResponse } from '../CustomRoadmap'; |
|
|
|
import type { GetRoadmapResponse } from '../CustomRoadmap'; |
|
|
|
|
|
|
|
import { useState } from 'react'; |
|
|
|
|
|
|
|
import { SubmitShowcaseWarning } from './SubmitShowcaseWarning'; |
|
|
|
|
|
|
|
|
|
|
|
type ShowcaseAlertProps = { |
|
|
|
type ShowcaseAlertProps = { |
|
|
|
currentRoadmap: GetRoadmapResponse; |
|
|
|
currentRoadmap: GetRoadmapResponse; |
|
|
@ -16,12 +11,12 @@ type ShowcaseAlertProps = { |
|
|
|
export function ShowcaseAlert(props: ShowcaseAlertProps) { |
|
|
|
export function ShowcaseAlert(props: ShowcaseAlertProps) { |
|
|
|
const { currentRoadmap } = props; |
|
|
|
const { currentRoadmap } = props; |
|
|
|
|
|
|
|
|
|
|
|
// const { showcaseStatus = 'idle' } = currentRoadmap;
|
|
|
|
const [showRejectedReason, setShowRejectedReason] = useState(false); |
|
|
|
// if (showcaseStatus === 'idle') {
|
|
|
|
|
|
|
|
// return null;
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const showcaseStatus = 'rejected_with_reason'; |
|
|
|
const { showcaseStatus = 'idle' } = currentRoadmap; |
|
|
|
|
|
|
|
if (showcaseStatus === 'idle') { |
|
|
|
|
|
|
|
return null; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const showcaseStatusMap = { |
|
|
|
const showcaseStatusMap = { |
|
|
|
submitted: { |
|
|
|
submitted: { |
|
|
@ -45,7 +40,12 @@ export function ShowcaseAlert(props: ShowcaseAlertProps) { |
|
|
|
label: ( |
|
|
|
label: ( |
|
|
|
<> |
|
|
|
<> |
|
|
|
Your roadmap needs changes before it can be featured.{' '} |
|
|
|
Your roadmap needs changes before it can be featured.{' '} |
|
|
|
<button className="font-medium underline underline-offset-2 hover:no-underline"> |
|
|
|
<button |
|
|
|
|
|
|
|
className="font-medium underline underline-offset-2 hover:no-underline" |
|
|
|
|
|
|
|
onClick={() => { |
|
|
|
|
|
|
|
setShowRejectedReason(true); |
|
|
|
|
|
|
|
}} |
|
|
|
|
|
|
|
> |
|
|
|
Check Reason |
|
|
|
Check Reason |
|
|
|
</button> |
|
|
|
</button> |
|
|
|
</> |
|
|
|
</> |
|
|
@ -56,20 +56,30 @@ export function ShowcaseAlert(props: ShowcaseAlertProps) { |
|
|
|
const { icon: Icon, label, className } = showcaseStatusMap[showcaseStatus]; |
|
|
|
const { icon: Icon, label, className } = showcaseStatusMap[showcaseStatus]; |
|
|
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
return ( |
|
|
|
<div |
|
|
|
<> |
|
|
|
className={cn( |
|
|
|
{showRejectedReason && ( |
|
|
|
showcaseStatus === 'submitted' && 'bg-blue-100', |
|
|
|
<SubmitShowcaseWarning |
|
|
|
showcaseStatus === 'approved' && 'bg-green-100', |
|
|
|
onClose={() => { |
|
|
|
showcaseStatus === 'rejected' && 'bg-red-100', |
|
|
|
setShowRejectedReason(false); |
|
|
|
showcaseStatus === 'rejected_with_reason' && 'bg-yellow-100', |
|
|
|
}} |
|
|
|
|
|
|
|
/> |
|
|
|
)} |
|
|
|
)} |
|
|
|
> |
|
|
|
|
|
|
|
<div className="container relative flex items-center justify-center py-2 text-sm"> |
|
|
|
<div |
|
|
|
<div className={cn('flex items-center gap-2', className)}> |
|
|
|
className={cn( |
|
|
|
<Icon className="h-4 w-4 shrink-0 stroke-[2.5]" /> |
|
|
|
showcaseStatus === 'submitted' && 'bg-blue-100', |
|
|
|
<div>{label}</div> |
|
|
|
showcaseStatus === 'approved' && 'bg-green-100', |
|
|
|
|
|
|
|
showcaseStatus === 'rejected' && 'bg-red-100', |
|
|
|
|
|
|
|
showcaseStatus === 'rejected_with_reason' && 'bg-yellow-100', |
|
|
|
|
|
|
|
)} |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
<div className="container relative flex items-center justify-center py-2 text-sm"> |
|
|
|
|
|
|
|
<div className={cn('flex items-center gap-2', className)}> |
|
|
|
|
|
|
|
<Icon className="h-4 w-4 shrink-0 stroke-[2.5]" /> |
|
|
|
|
|
|
|
<div>{label}</div> |
|
|
|
|
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</> |
|
|
|
); |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|