39 lines
998 B
TypeScript
39 lines
998 B
TypeScript
"use client";
|
|
|
|
import { Paperclip, X } from "lucide-react";
|
|
|
|
import { TextShimmer } from "./text-shimmer";
|
|
|
|
interface UploadedFileChipProps {
|
|
fileName: string;
|
|
isUploading?: boolean;
|
|
onRemove?: () => void;
|
|
}
|
|
|
|
function UploadedFileChip({ fileName, isUploading = false, onRemove }: UploadedFileChipProps) {
|
|
return (
|
|
<div className="inline-flex items-center justify-between gap-2 rounded-sm border bg-accent px-3 py-2">
|
|
<Paperclip className="size-5 shrink-0" />
|
|
<TextShimmer className="text-xl" active={isUploading}>
|
|
{fileName}
|
|
</TextShimmer>
|
|
{onRemove ? (
|
|
<button
|
|
type="button"
|
|
aria-label="삭제"
|
|
onClick={(event) => {
|
|
event.preventDefault();
|
|
onRemove();
|
|
}}
|
|
disabled={isUploading}
|
|
>
|
|
<X className="size-5 shrink-0 text-destructive" />
|
|
</button>
|
|
) : null}
|
|
</div>
|
|
);
|
|
}
|
|
|
|
export { UploadedFileChip };
|
|
export type { UploadedFileChipProps };
|