"use client"
import {
CheckCircleSolid,
CircleDottedLine,
CircleHalfSolid,
} from "@medusajs/icons"
import * as ProgressTabsPrimitives from "@radix-ui/react-tabs"
import * as React from "react"
import { ProgressStatus } from "@/types"
import { clx } from "@/utils/clx"
/**
* This component is based on the [Radix UI Tabs](https://radix-ui.com/primitives/docs/components/tabs) primitves.
*
* @excludeExternal
*/
const ProgressTabsRoot = (props: ProgressTabsPrimitives.TabsProps) => {
return
}
ProgressTabsRoot.displayName = "ProgressTabs"
interface IndicatorProps
extends Omit, "children"> {
/**
* The current status.
*/
status?: ProgressStatus
}
const ProgressIndicator = ({ status, className, ...props }: IndicatorProps) => {
const Icon = React.useMemo(() => {
switch (status) {
case "not-started":
return CircleDottedLine
case "in-progress":
return CircleHalfSolid
case "completed":
return CheckCircleSolid
default:
return CircleDottedLine
}
}, [status])
return (
)
}
ProgressIndicator.displayName = "ProgressTabs.ProgressIndicator"
interface ProgressTabsTriggerProps
extends Omit<
React.ComponentPropsWithoutRef,
"asChild"
> {
status?: ProgressStatus
}
const ProgressTabsTrigger = React.forwardRef<
React.ElementRef,
ProgressTabsTriggerProps
>(
(
{
className,
children,
status = "not-started",
...props
}: ProgressTabsTriggerProps,
ref
) => (
{children}
)
)
ProgressTabsTrigger.displayName = "ProgressTabs.Trigger"
const ProgressTabsList = React.forwardRef<
React.ElementRef,
React.ComponentPropsWithoutRef
>(({ className, ...props }, ref) => (
))
ProgressTabsList.displayName = "ProgressTabs.List"
const ProgressTabsContent = React.forwardRef<
React.ElementRef,
React.ComponentPropsWithoutRef
>(({ className, ...props }, ref) => {
return (
)
})
ProgressTabsContent.displayName = "ProgressTabs.Content"
const ProgressTabs = Object.assign(ProgressTabsRoot, {
Trigger: ProgressTabsTrigger,
List: ProgressTabsList,
Content: ProgressTabsContent,
})
export { ProgressTabs }