feat: 클리닉 전용 페이지 추가, PageContainer 도입, 불필요한 ui 주석처리
This commit is contained in:
1 parent
e66b208318
commit
49367756ea
77 files changed
+3498
-924
No files matched your search
@@ -22,19 +22,9 @@
|
||||
* - variant='cta': 다크 배경 (CTA 섹션)
|
||||
*/
|
||||
|
||||
import { useMemo, useState, type ReactElement } from 'react';
|
||||
import { useMemo, useState } from 'react';
|
||||
import { ArrowRight } from 'lucide-react';
|
||||
import {
|
||||
GlobeFilled,
|
||||
YoutubeFilled,
|
||||
InstagramFilled,
|
||||
FacebookFilled,
|
||||
DatabaseFilled,
|
||||
FileTextFilled,
|
||||
MessageFilled,
|
||||
CheckFilled,
|
||||
WarningFilled,
|
||||
} from '@/shared/icons/FilledIcons';
|
||||
import { CheckFilled, WarningFilled } from '@/shared/icons/FilledIcons';
|
||||
import {
|
||||
classifyUrls,
|
||||
hasAnalyzableChannels,
|
||||
@@ -42,6 +32,8 @@ import {
|
||||
type ClassifiedUrls,
|
||||
} from '../lib/classifyUrls';
|
||||
import { Button } from '@/shared/ui/button';
|
||||
import { PLATFORM_META } from '@/features/clinics/components/PlatformChips';
|
||||
import type { PlatformKey } from '@/features/clinics/types/workspace';
|
||||
|
||||
/** discover-channels Edge Function에 전달되는 수동 채널 URL 묶음. */
|
||||
export interface ManualChannels {
|
||||
@@ -69,26 +61,35 @@ interface MultiChannelInputProps {
|
||||
|
||||
type ChannelKey = keyof Omit<ClassifiedUrls, 'unknown'>;
|
||||
|
||||
/** 채널별 메타 — 라벨/아이콘/색상/플레이스홀더 (뷰성형외과 실 URL을 데모 placeholder로). */
|
||||
const CHANNEL_META: Array<{
|
||||
key: ChannelKey;
|
||||
label: string;
|
||||
Icon: (props: { size?: number; className?: string }) => ReactElement;
|
||||
color: string;
|
||||
placeholder: string;
|
||||
}> = [
|
||||
{ key: 'homepage', label: '홈페이지', Icon: GlobeFilled, color: 'text-brand-purple', placeholder: 'viewclinic.com' },
|
||||
{ key: 'youtube', label: 'YouTube', Icon: YoutubeFilled, color: 'text-[#FF0000]', placeholder: 'youtube.com/@ViewclinicKR' },
|
||||
{ key: 'instagram', label: 'Instagram', Icon: InstagramFilled,color: 'text-[#E1306C]', placeholder: 'instagram.com/viewplastic' },
|
||||
{ key: 'facebook', label: 'Facebook', Icon: FacebookFilled, color: 'text-[#1877F2]', placeholder: 'facebook.com/viewps1' },
|
||||
{ key: 'naverPlace', label: '네이버 플레이스', Icon: DatabaseFilled, color: 'text-[#03C75A]', placeholder: 'place.naver.com/hospital/11709005' },
|
||||
{ key: 'naverBlog', label: '네이버 블로그', Icon: FileTextFilled, color: 'text-[#03C75A]', placeholder: 'blog.naver.com/viewclinicps' },
|
||||
{ key: 'gangnamUnni', label: '강남언니', Icon: MessageFilled, color: 'text-[#FF5C89]', placeholder: 'gangnamunni.com/hospitals/189' },
|
||||
/** ChannelKey(분류기 결과 키) → 공통 PlatformKey 매핑 — 'homepage' ↔ 'website' 만 다름 */
|
||||
const CHANNEL_TO_PLATFORM: Record<ChannelKey, PlatformKey> = {
|
||||
homepage: 'website',
|
||||
youtube: 'youtube',
|
||||
instagram: 'instagram',
|
||||
facebook: 'facebook',
|
||||
naverPlace: 'naverPlace',
|
||||
naverBlog: 'naverBlog',
|
||||
gangnamUnni: 'gangnamUnni',
|
||||
};
|
||||
|
||||
const PLACEHOLDER: Record<ChannelKey, string> = {
|
||||
homepage: 'viewclinic.com',
|
||||
youtube: 'youtube.com/@ViewclinicKR',
|
||||
instagram: 'instagram.com/viewplastic',
|
||||
facebook: 'facebook.com/viewps1',
|
||||
naverPlace: 'place.naver.com/hospital/11709005',
|
||||
naverBlog: 'blog.naver.com/viewclinicps',
|
||||
gangnamUnni: 'gangnamunni.com/hospitals/189',
|
||||
};
|
||||
|
||||
/** 채널 입력 순서 — 공통 PLATFORM_META 의 label/color/Icon 을 그대로 사용 */
|
||||
const CHANNEL_ORDER: ChannelKey[] = [
|
||||
'homepage', 'youtube', 'instagram', 'facebook', 'naverPlace', 'naverBlog', 'gangnamUnni',
|
||||
];
|
||||
|
||||
type EmptyClassified = Record<ChannelKey, string>;
|
||||
type ChannelUrlInputs = Record<ChannelKey, string>;
|
||||
|
||||
const EMPTY_URLS: EmptyClassified = {
|
||||
const EMPTY_URLS: ChannelUrlInputs = {
|
||||
homepage: '', youtube: '', instagram: '', facebook: '',
|
||||
naverPlace: '', naverBlog: '', gangnamUnni: '',
|
||||
};
|
||||
@@ -109,7 +110,7 @@ function validateField(value: string, expected: ChannelKey): 'empty' | 'valid' |
|
||||
}
|
||||
|
||||
export default function MultiChannelInput({ variant = 'hero', onAnalyze }: MultiChannelInputProps) {
|
||||
const [urls, setUrls] = useState<EmptyClassified>(EMPTY_URLS);
|
||||
const [urls, setUrls] = useState<ChannelUrlInputs>(EMPTY_URLS);
|
||||
|
||||
// 통합 분류 결과 — 7개 필드 값을 join해 classifyUrls에 한 번에 통과시켜 manualChannels 구성.
|
||||
const aggregated = useMemo(() => {
|
||||
@@ -153,29 +154,35 @@ export default function MultiChannelInput({ variant = 'hero', onAnalyze }: Multi
|
||||
<div className="w-full max-w-2xl mx-auto">
|
||||
{/* 7개 채널별 입력 필드 — 한 줄에 하나, 좌측 아이콘 + 우측 검증 상태 */}
|
||||
<div className="flex flex-col gap-2">
|
||||
{CHANNEL_META.map(({ key, label, Icon, color, placeholder }) => {
|
||||
{CHANNEL_ORDER.map((key) => {
|
||||
const meta = PLATFORM_META[CHANNEL_TO_PLATFORM[key]];
|
||||
const Icon = meta.Icon;
|
||||
const value = urls[key];
|
||||
const status = validateField(value, key);
|
||||
const inactiveColor = isHero ? '#94a3b8' /* slate-400 */ : 'rgba(255,255,255,0.4)';
|
||||
return (
|
||||
<div key={key} className="relative">
|
||||
{/* 좌측 채널 아이콘 — 입력 시 컬러 적용, 빈 칸일 땐 회색 */}
|
||||
<div className="absolute left-3 top-1/2 -translate-y-1/2 pointer-events-none flex items-center gap-2">
|
||||
<Icon size={16} className={value ? color : isHero ? 'text-slate-400' : 'text-white/40'} />
|
||||
{/* 좌측 채널 아이콘 — 입력 시 브랜드 컬러, 빈 칸일 땐 회색.
|
||||
z-10 으로 input 의 bg/backdrop-blur 위에 올림 (없으면 input 배경이 아이콘을 가림) */}
|
||||
<div className="absolute left-3 top-1/2 -translate-y-1/2 pointer-events-none flex items-center gap-2 z-10">
|
||||
<Icon
|
||||
size={16}
|
||||
style={{ color: value ? meta.color : inactiveColor }}
|
||||
/>
|
||||
</div>
|
||||
{/* 채널 라벨 — 좌측 상단 작은 라벨로 placeholder 위에 노출 */}
|
||||
<input
|
||||
type="url"
|
||||
inputMode="url"
|
||||
value={value}
|
||||
onChange={(e) => setUrls((prev) => ({ ...prev, [key]: e.target.value }))}
|
||||
placeholder={`${label} · ${placeholder}`}
|
||||
aria-label={label}
|
||||
placeholder={`${meta.label} · ${PLACEHOLDER[key]}`}
|
||||
aria-label={meta.label}
|
||||
className={inputClass}
|
||||
spellCheck={false}
|
||||
autoComplete="off"
|
||||
/>
|
||||
{/* 우측 검증 상태 아이콘 */}
|
||||
<div className="absolute right-3 top-1/2 -translate-y-1/2 pointer-events-none">
|
||||
{/* 우측 검증 상태 아이콘 — 동일하게 z-10 */}
|
||||
<div className="absolute right-3 top-1/2 -translate-y-1/2 pointer-events-none z-10">
|
||||
{status === 'valid' && (
|
||||
<CheckFilled size={16} className="text-emerald-500" />
|
||||
)}
|
||||
|
||||
@@ -11,6 +11,7 @@ import {
|
||||
import type { ComponentType } from 'react';
|
||||
import { Button } from '@/shared/ui/button';
|
||||
import { Input } from '@/shared/ui/input';
|
||||
import { PageContainer } from '@/shared/ui/page-container';
|
||||
|
||||
interface ChannelDef {
|
||||
id: string;
|
||||
@@ -204,7 +205,7 @@ export default function ChannelConnectPage() {
|
||||
<div className="pt-20 min-h-screen">
|
||||
{/* Header */}
|
||||
<div className="bg-gradient-to-r from-brand-grad-peach via-brand-grad-violet to-brand-grad-sky py-16 px-6">
|
||||
<div className="max-w-5xl mx-auto">
|
||||
<PageContainer className="max-w-5xl px-0">
|
||||
<p className="text-xs font-semibold text-brand-purple-vivid tracking-widest uppercase mb-3">Channel Integration</p>
|
||||
<h1 className="font-serif text-3xl md:text-4xl font-bold text-brand-purple-deep mb-3">
|
||||
채널 연결
|
||||
@@ -233,11 +234,11 @@ export default function ChannelConnectPage() {
|
||||
</Button>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</PageContainer>
|
||||
</div>
|
||||
|
||||
{/* Channel Grid */}
|
||||
<div className="max-w-5xl mx-auto px-6 py-12">
|
||||
<PageContainer className="max-w-5xl py-12">
|
||||
<div className="grid grid-cols-1 md:grid-cols-2 gap-4">
|
||||
{CHANNELS.map(ch => {
|
||||
const state = channels[ch.id];
|
||||
@@ -370,7 +371,7 @@ export default function ChannelConnectPage() {
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
</div>
|
||||
</PageContainer>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user